This is still needed so that injectJs() methods work with CoffeeScript
and so that the main script file can be in CoffeeScript.
It causes duplication of code and some consideration is needed as to
how we could refactor the old inject code so that it uses modules
underneath. Lots of the module functionality written in JS could replace
the old C++ code (CSConverter, most functions in Utils).
http://code.google.com/p/phantomjs/issues/detail?id=47
add a default error handler on all pages. people can override if they
need.
ensure error handler can be removed without errors.
Hack ScriptSourceCode so we can pass in a raw string and not have it
validated as a URL
change source location hint for webpage.evaluate().
http://code.google.com/p/phantomjs/issues/detail?id=166
Please enter the commit message for your changes. Lines starting
* Some code reuse
* Centralised in Utils the loading of resource files
* It is safe to assume, when loading a resource file, that IT'S THERE and IT'S READABLE
* ALSO, I removed the unused 'shims' (we forgot them in there :P)
The reason for this is for consistencies sake. When we have a JavaScript
evaluation error, it shows the error, but doesn't exit the program.
Since we can inject CoffeeScripts as well as JS, it wouldn't be
consistent to exit the program. So we just warn instead.
* "injectJs()" now supports ".coffee" input
* "injectJs()" is now available for the "phantom" object as well
* CSConverter is now a singleton embedded in the Utils static class
* The code used by "injectJs()" is now centralised in the Utils static class
Also:
* I added a couple of "qFatal" where it makes sense.
* Usage now mentions the fact that the input files that finish by ".coffee" are also acceptable