Commit Graph

1260 Commits (0632658afec4a110d3cb981118aea4914369e107)

Author SHA1 Message Date
Ariya Hidayat 0632658afe Add a simple example to show how the module system works.
http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-13 07:58:05 -07:00
Juliusz Gonera 0ce2974ff7 Include the browser version of CoffeeScript too
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
2012-07-12 23:14:53 -07:00
Juliusz Gonera a02cf63984 Add support for CoffeeScript modules
Instead of using a C++ wrapper, I used a Node version of CoffeeScript
with a small JS wrapper (src/modules/_coffee-script.js). This way, since
the module system is similar enough to the Node.js module system, I only
need to require CoffeeScript in bootstrap.js and all the support for
.coffee is added by CoffeeScript itself.

To include a newer version of CoffeeScript in the source tree, see
tools/import-coffee-script.sh.

http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:13 -07:00
Juliusz Gonera 2555cb448c Refactor loading of native PhantomJS modules
Now PhantomJS modules are loaded just like any other modules, which
means they should be able to require other native modules inside them if
needed.

http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:13 -07:00
Juliusz Gonera 15204cb8ae Run modules in an empty context
Previously `this` in modules was set to the global `window` object. Now it
is set to an empty object instead.

http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:13 -07:00
Juliusz Gonera 5015dbec2a Remove old module tests
New module tests contain all the tests from the old ones.

http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:12 -07:00
Juliusz Gonera 893108ad11 Fix stack trace when module is not found
The stack trace was missing when an error was thrown because of a
missing module. This should not be the case anymore.

http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:12 -07:00
Juliusz Gonera ba3eabb29e Refactor nativeRequire() and restructure bootstrap.js
nativeRequire() has been refactored so that native modules are also
wrapped in Module objects. Additionally, native modules are also
cached and included in stack traces if an error occures inside them.

Phantom::loadModuleSource() has been renamed to
Phantom::readNativeModule() so that it's clear that it's used only to
load native modules.

Finally, all the require() code has been move after setting error
handlers in bootstrap.js so that if an error occurs in the require()
code, the stack trace is printed.

http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:12 -07:00
Juliusz Gonera b22e995337 Fix indentation to 4 spaces in new require() tests
http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:12 -07:00
Juliusz Gonera fdd727e5da Add Phantom::loadModule
Instead of trying to use sourceId to determine what module threw an
error, we now load module's source code using modified
QWebFrame::evaluateJavaScript and leverage PhantomJS's stack traces.

http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:12 -07:00
Juliusz Gonera 70925a873b Add test for .stack in errors thrown in modules
We want to be sure that the stack contains module file path.

http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:12 -07:00
Juliusz Gonera 2cfffa029a Merge phantomjs-nodify's require() and fix tests
Most of the tests passed after merging almost unchanged phantomjs-nodify
code, some needed small changes. The one that is still failing is for
CoffeeScript modules.

http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:12 -07:00
Juliusz Gonera 945a4c0f8c Add require() tests and comment buggy test in fs-spec-03.js
http://code.google.com/p/phantomjs/issues/detail?id=47
2012-07-12 23:14:12 -07:00
Jon Leighton 7892ff3b3e Deploy script improvements.
http://code.google.com/p/phantomjs/issues/detail?id=599

Squashed commit of the following:

commit 2cdcf8a47567f3c067958383843cccf858af531c
Author: Jon Leighton <j@jonathanleighton.com>
Date:   Sat Jul 7 19:37:38 2012 +0100

    Make lib-bundling/brandelf optional in deploy/package.sh

    This configuration has had some problems and we don't wish to use it in
    the official packages.

    Enable it with --bundle-libs.

commit 2a2155a4e1f5873aa8624859cead9d66750747f4
Author: Jon Leighton <j@jonathanleighton.com>
Date:   Sat Jul 7 19:24:40 2012 +0100

    notify user if upx is missing

commit 9656a99df0ff101150276dc88e0127f68041f617
Author: Jon Leighton <j@jonathanleighton.com>
Date:   Sat Jul 7 19:23:36 2012 +0100

    stripping symbols after upx probably doesn't work, reorder that

commit c5f425dc17069c89e7d2ff274309006c728ffab4
Author: Jon Leighton <j@jonathanleighton.com>
Date:   Sat Jul 7 19:17:07 2012 +0100

    fix logical fail
2012-07-08 17:42:58 -07:00
Jon Leighton 1bcacde12c Increase VM memory. Necessary for linking on 64-bit build.
http://code.google.com/p/phantomjs/issues/detail?id=599
2012-07-07 08:03:02 -07:00
Ariya Hidayat c0e8aa996f Merge branch 'master' of github.com:ariya/phantomjs 2012-07-07 08:00:30 -07:00
Ariya Hidayat 940e0089ba Merge pull request #291 from jonleighton/static_inspector
Fix remote inspector when building statically.
2012-07-07 08:00:07 -07:00
Jon Leighton 95186c653e Fix remote inspector when building statically.
For some reason, it seems that checking CONFIG(static) inside
src/phantomjs.pro is not reliable. That caused the STATIC_BUILD define
not to be set, and hence Q_INIT_RESOURCE would never get called in
main.cpp.

Instead of using Q_INIT_RESOURCE, let's just compile the resources
directly into the phantomjs binary. This means we don't need to detect
whether Qt is linked statically or dynamically.

https://code.google.com/p/phantomjs/issues/detail?id=430
2012-07-07 15:38:04 +01:00
Ariya Hidayat 13d929f3dc Merge branch 'master' of github.com:ariya/phantomjs 2012-07-05 09:21:04 -07:00
Ariya Hidayat 516c70b4fd Merge pull request #289 from detro/master
Version bump
2012-07-04 08:00:28 -07:00
Ivan De Marino 7409ec62d0 Bumping version to "1.7.0 (development)" 2012-07-03 22:50:11 +01:00
Ariya Hidayat df0f70f0b7 Merge pull request #284 from jonleighton/deploy2
Deploy fixes
2012-06-29 07:48:02 -07:00
Jon Leighton e05c887c96 Use zip for the OS X package
Requested by @ariya, who was concerned that .tar.bz2 might be confusing to
OS X users who are not well-versed in UNIX.
2012-06-29 14:54:39 +01:00
Jon Leighton 5f510967db Fix the top-level folder name in the packaged symbol tarball. 2012-06-29 14:44:10 +01:00
Jon Leighton a714bab04b Fix symbols generation on Linux
We are linking against e.g. libQtCore.so.4 rather than
libQtCore.so.4.8.2, and this affects symbol generation. (I am not sure
if this changed at some point, but this change should make it generate
the correct symbol files regardless.)

Also makes it less dependent on the Qt version.
2012-06-29 14:31:53 +01:00
Jon Leighton 13c1c164d9 Don't build the deploy in debug mode.
Debug mode turns off all optimisations. This make PhantomJS considerably
slower.

Instead, we build in 'release' mode, but generate debugging symbols at
the same time.

This may present some problems analysing crashes, if the optimisations
make that difficult. However, in my testing I was able to get useful
debug output even with optimisations enabled. So we should see how we go
- if it becomes a problem we can produce seperate debug binaries with no
optimisations.

https://code.google.com/p/phantomjs/issues/detail?id=599
2012-06-29 14:27:48 +01:00
Ariya Hidayat 59f6bb9496 ChangeLog fix: it's onPrompt and not onAlert.
Thanks to Ryuichi Okumura <okuryu@gmail.com> for the notice.

http://code.google.com/p/phantomjs/issues/detail?id=598
2012-06-26 08:20:00 -07:00
Ariya Hidayat ca7e8bb8f3 Merge pull request #281 from detro/master
Forgot to update completions for renderBase64
2012-06-25 01:47:40 -07:00
Ivan De Marino 5ad891c2f3 Forgot to update completions for renderBase64 2012-06-24 19:40:41 -07:00
Ariya Hidayat 3da512370e Lavender.
http://code.google.com/p/phantomjs/issues/detail?id=598
2012-06-20 23:28:26 -07:00
Ariya Hidayat 91d31ffe9e Fix Twitter-related examples to work with the new site.
http://code.google.com/p/phantomjs/issues/detail?id=609
2012-06-20 22:55:04 -07:00
Ariya Hidayat 9c05341698 Changes for Lavender.
http://code.google.com/p/phantomjs/issues/detail?id=598
2012-06-20 21:24:46 -07:00
Ariya Hidayat 8c46d6db83 Only compress with UPX if it's available.
Also, make sure we use the maximum compression level.

http://code.google.com/p/phantomjs/issues/detail?id=599
2012-06-20 21:18:37 -07:00
Ariya Hidayat 06e424b614 Merge pull request #278 from jonleighton/deploy
fix lib paths for dump-symbols.sh
2012-06-20 07:48:08 -07:00
Jon Leighton eca983cdda fix lib paths for dump-symbols.sh 2012-06-20 09:15:03 +01:00
Ariya Hidayat 959f8ca323 Merge pull request #277 from jonleighton/deploy
A couple of packaging script tweaks
2012-06-19 17:23:44 -07:00
Jon Leighton 7ff61604e3 use upx to compress binary on OS X 2012-06-19 23:49:06 +01:00
Jon Leighton d0ee703529 tweak/fix provision-vm.sh 2012-06-19 23:19:49 +01:00
Ariya Hidayat 78d23935a5 Update CoffeeScript compiler to version 1.3.3.
http://code.google.com/p/phantomjs/issues/detail?id=496
2012-06-18 22:40:51 -07:00
Ariya Hidayat 23469d6cde Merge pull request #276 from jonleighton/breakpad
Breakpad / deploy stuff
2012-06-18 20:59:35 -07:00
Ariya Hidayat e5f695a0b4 Merge pull request #275 from jonleighton/stacktraces
Fix segfault when using e.g. console.error
2012-06-18 20:59:12 -07:00
Jon Leighton fe784b45e6 PhantomJS itself also needs to be build in debug mode.
https://code.google.com/p/phantomjs/issues/detail?id=599
2012-06-19 00:30:17 +01:00
Jon Leighton aa533a5659 ignore deploy/brandelf 2012-06-19 00:29:18 +01:00
Tom Stuart & Jon Leighton 5fa0202f29 Add breakpad support for Mac
This provides support for compiling the breakpad client into PhantomJS,
and generifies that Linux packaging scripts so that they also apply to
OS X and automate the symbol generation.

Building the Breakpad tool programs seems to be less than
straightforward on OS X, and documentation is poor. We have managed to
produce tools/dump-syms-mac.pro which allows building the dump_syms
program for dumping the debugging symbols. This needed a couple of
modifications to breakpad in order to compile successfully.

We have run out of time to work on making the minidump_stackwalk program
build. However, this is solely a developer tool and so it can wait until
after the 1.6 release before we complete this work.

Testing is welcome!

https://code.google.com/p/phantomjs/issues/detail?id=576
2012-06-19 00:28:37 +01:00
Jon Leighton 439a58eaee Fix segfault when using e.g. console.error
When console.error was called, there was a segfault because it was
treated as an uncaught exception, but did not have the correct stack
trace information (I am not sure why, but still...)

Now that we are generating the stackTrace in WebCore::reportException,
the MessageType gets set correctly, so we can use this to differentiate
between uncaught exceptions and other messages.

https://code.google.com/p/phantomjs/issues/detail?id=47
2012-06-18 23:43:50 +01:00
Ariya Hidayat c3c65df12d Merge pull request #273 from ferama/master
fix wrong pdf margins using custom header/footer
2012-06-18 06:53:29 -07:00
Marco Ferragina 1a3be3bbce fix wrong pdf margins using custom header/footer
see issue http://code.google.com/p/phantomjs/issues/detail?id=588
2012-06-18 12:25:14 +02:00
Ariya Hidayat 37cfc05a9b Merge pull request #272 from detro/master
Minor adjustments before 1.6
2012-06-17 22:20:12 -07:00
Ivan De Marino b443b7add8 Changing the "working directory" to "/test" before running tests.
This fixes some issues with our tests, where we were erroneously failing.
2012-06-17 19:37:24 -07:00
Ivan De Marino bd6f1f2ffe Adding a Q_UNUSED to removing compilation annoyance. 2012-06-17 19:21:44 -07:00