0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-09-19 00:25:18 +00:00
Commit Graph

266 Commits

Author SHA1 Message Date
Stefan Siegl
289e382e63
re-add module focused unicode test 2017-09-25 15:08:23 +02:00
Stefan Siegl
d6561fe7dc
fix test filename 2017-09-25 15:03:46 +02:00
Stefan Siegl
ec49c03c0f
fix test-file syntax 2017-09-25 15:03:34 +02:00
Stefan Siegl
ef90ad7065
Revert "Create unicode.php"
This reverts commit 3559f1797e.
2017-09-25 15:01:37 +02:00
Stefan Siegl
33b3ff5e1f
Revert "Renamed to unicode.phpt"
This reverts commit 202f0beefa.
2017-09-25 15:01:21 +02:00
Stefan Siegl
eba01e1088
Merge branch 'patch-2' of https://github.com/HoffmannP/v8js into php7 2017-09-25 14:50:42 +02:00
Stefan Siegl
82930c9ea9
Create deprecated warning if setting $report_uncaught_exceptions != true 2017-09-25 14:35:46 +02:00
Stefan Siegl
56e83a9fbb
mark clearPendingException & getPendingException functions deprecated 2017-09-25 14:28:16 +02:00
Stefan Siegl
22bcf85348
Write deprecation warning on non-empty $extensions array passed to V8Js::__construct 2017-09-25 14:06:33 +02:00
Stefan Siegl
9734466105
mark registerExtension & getExtensions deprecated + adapt test output 2017-09-25 13:45:19 +02:00
Peter Hoffmann
202f0beefa Renamed to unicode.phpt
added test for commonJS modules
2017-06-12 11:20:11 +02:00
Peter Hoffmann
3559f1797e Create unicode.php
Create compatibility with versions compiled without snapshot support
2017-06-12 10:37:54 +02:00
Peter Hoffmann
2c60547ece Update unicode.php
removed flagg that was misplaced and would've been useless
2017-06-12 10:11:02 +02:00
Peter Hoffmann
2fbd780771 Create test for unicode symbols
This test is created b/c the same test with extensions would fail (see #317)
2017-06-09 14:45:45 +02:00
Stefan Siegl
36f52e84d1
Add test for #316 2017-06-08 23:15:06 +02:00
Stefan Siegl
09f69caf64
Relax test to work on V8 without i18n support 2017-04-14 22:48:39 +02:00
Stefan Siegl
c957be8b2a
Initialize ICU as (meanwhile) needed 2017-04-14 21:00:31 +02:00
Stefan Siegl
54e3a07bc8 make exception_start_column.phpt green again, closes #302
Test began to fail with V8 ~5.9.35 which started to report different
column numbers of errors.  Adapt test so it works well with older
and newer versions of V8.
2017-03-14 07:28:24 +01:00
Stefan Siegl
397c5f0e09 load ext-dom for test, if available, refs #270 2017-03-12 10:09:59 +01:00
Stefan Siegl
346c47b657 skip long_int64 test on 32bit PHP versions 2017-03-08 07:58:38 +01:00
Stefan Siegl
b45bef46de pick up int64 export test from issue #287 2017-03-08 07:54:48 +01:00
Stefan Siegl
3970fdebc7 Adapt test output to V8 5.7 2017-01-22 14:18:26 +01:00
Stefan Siegl
de71f83b7f Merge pull request #252 from stesie/issue-246
Handle Z_TYPE == IS_REFERENCE well, fixes #246
2016-08-12 15:42:40 +02:00
Stefan Siegl
9d3ff2868c Remove hard-coded pathname from test 2016-08-12 01:11:51 +02:00
Stefan Siegl
5ae48bbda7 Fix refcounting, use zval_ptr_dtor, closes #250 2016-08-12 01:02:56 +02:00
Stefan Siegl
8126fc4928 Handle Z_TYPE == IS_REFERENCE well, fixes #246 2016-08-11 18:54:38 +02:00
Stefan Siegl
9fd201eb16 forward exceptions thrown in module normaliser 2016-07-03 22:57:11 +02:00
Stefan Siegl
7dcebdd927 forward exceptions thrown in module loader 2016-07-03 22:52:50 +02:00
Stefan Siegl
802cdd350a Drop tests/magic_func.phpt which got flaky
Most recent PHP7.0 versions implicitly call __isset before __get, which
older ones don't.

The test needs some major refactoring, after all the file is huge
and better split into smaller pieces.
2016-05-22 23:28:02 +02:00
Stefan Siegl
e9e90bac65 Merge remote-tracking branch 'origin/master' into php7
Conflicts:
      config.w32
      package.xml
      php_v8js_macros.h
      v8js.cc
      v8js_array_access.cc
      v8js_class.cc
      v8js_convert.cc
      v8js_exceptions.cc
      v8js_object_export.cc
      v8js_timer.cc
      v8js_v8.cc
      v8js_v8object_class.cc
2016-05-22 22:30:19 +02:00
Stefan Siegl
3d5f163899 skip time/memory limit tests on SKIP_SLOW_TESTS 2016-03-26 11:47:58 +01:00
Stefan Siegl
b0f761ae3b Merge pull request #221 from stesie/fluent-setters-js
Retain object identity on JS-side 'return this'
2016-03-25 23:20:16 +01:00
Stefan Siegl
93b1118fe8 Retain object identity on JS-side 'return this' 2016-03-25 22:15:05 +01:00
Stefan Siegl
d44592910d Retain object indentity on 'return $this' 2016-03-25 19:15:25 +01:00
Stefan Siegl
d6394301b2 Pass back V8Object instances, don't re-wrap 2016-03-25 17:40:43 +01:00
Stefan Siegl
12903ca269 add V8Js::setAverageObjectSize method 2016-03-08 09:28:16 +01:00
Stefan Siegl
bf6effba63 Merge remote-tracking branch 'origin/master' into php7 2016-03-05 22:21:42 +01:00
Stefan Siegl
87b29749b9 Merge pull request #207 from stesie/custom-snapshots
Handle V8 heap snapshots well + allow custom snapshot generation
2016-03-05 19:27:40 +01:00
Stefan Siegl
67269ddfc4 Adapt test expectations to V8 error message changes
V8 5.1 uses slightly changed SyntaxError messages.
This adapts our tests as needed (for support of V8 5.1 as well
as older versions)
2016-03-05 17:11:52 +01:00
Stefan Siegl
4df6e80be9 Add testcase on V8Js::createSnapshot 2016-03-05 14:12:19 +01:00
Stefan Siegl
3808f69dea Adapt tests V8 3.24 also 2016-01-09 21:45:10 +01:00
Stefan Siegl
796ae85cb6 Adapt tests to different V8 versions 2016-01-09 21:36:30 +01:00
Stefan Siegl
4a8a8b812f Add test that V8Js::__sleep and V8Js::__wakeup are final 2016-01-09 19:15:12 +01:00
Stefan Siegl
d438624a3d Don't export V8Js methods even if overwritten 2016-01-09 19:11:30 +01:00
Stefan Siegl
1e86e2c9f7 Don't export methods of V8Js object to V8 2016-01-09 19:02:58 +01:00
Stefan Siegl
e2636b2e71 Skip Generator export tests if not supported 2016-01-09 14:24:49 +01:00
Stefan Siegl
dbe29d7e96 Add more tests on exported (PHP) Generator objects 2016-01-09 13:19:23 +01:00
Stefan Siegl
a18ae9e853 Implement JS-side wrapper around PHP Generator objects 2016-01-09 12:50:40 +01:00
Stefan Siegl
e0f990bfa1 Add test with private/protected methods, refs #183 2016-01-08 15:47:24 +01:00
Stefan Siegl
38b9c053a1 Enable V8Generator support on V8 >= 3.30.0 2016-01-08 00:12:06 +01:00
Stefan Siegl
a4b4934361 Relax EXPECTF, some V8 versions fail to provide the error location 2016-01-08 00:00:12 +01:00
Stefan Siegl
c500d0c21e Add test on property passing on generators 2016-01-07 23:19:31 +01:00
Stefan Siegl
798a87e481 Add test on fatal errors within JS generators 2016-01-07 23:16:59 +01:00
Stefan Siegl
46fba810af Add test on PHP exceptions thrown by JS generators 2016-01-07 23:15:13 +01:00
Stefan Siegl
479d14b5b0 Handle exceptions thrown in JS generators well 2016-01-07 23:12:43 +01:00
Stefan Siegl
6fa6f9316e Test yield from JS generators 2016-01-07 23:00:45 +01:00
Stefan Siegl
f97a25b69c Test & implement PHP-side instantiation of JS generators 2016-01-07 22:57:50 +01:00
Stefan Siegl
da64b9f055 Handle rewind on primed V8Generator 2016-01-07 22:48:01 +01:00
Stefan Siegl
e686603b89 Implement direct iteration on JS generators 2016-01-07 22:41:13 +01:00
Stefan Siegl
2c7a7ab87d Implement PHP-side iteration of JS generator objects 2016-01-07 21:35:44 +01:00
Stefan Siegl
ef779d8250 minimalist V8 -> PHP generator passing 2016-01-07 20:41:40 +01:00
Stefan Siegl
0945749e7c add basic test on issue #183 2016-01-07 13:44:40 +01:00
Stefan Siegl
adb8288061 Make set_time_limit tests slower
... to reduce the risk of false positives on slower (or busier) boxes.
2016-01-06 17:23:22 +01:00
Stefan Siegl
1d1b87bda3 skip extensions_error.phpt on Windows 2016-01-06 13:26:55 +00:00
Stefan Siegl
c2a2cc341f Initialize libv8_platform for Windows as well
V8 doesn't work without libplatform anymore, even under
Windows.

Furthermore adapted two tests to \r\n vs. \n line
ending differences
2016-01-06 11:58:40 +00:00
Stefan Siegl
362eb0b806 Merge pull request #190 from stesie/warn-only-on-v8-errors
Don't abort PHP on fatal V8 errors, just warn about it
2015-12-31 21:42:00 +01:00
Stefan Siegl
2d34adb91f Merge remote-tracking branch 'origin/master'
This primarily ports features introduced with V8Js 0.4.0
to the PHP7 branch.
2015-12-31 20:25:24 +01:00
Stefan Siegl
de23e8dba4 Don't abort PHP on fatal V8 errors, just warn about it
This way the PHP script can handle V8 errors gracefully
(and e.g. provide feedback to the user).

This especially changes behaviour when circular extension
dependencies happen (PHP code can go on, just V8 fails
to start).  This also fixes memory leaks of V8 and V8Js
itself caused by bailing out directly otherwise.
2015-12-30 17:53:46 +01:00
Stefan Siegl
3c5508b956 Provide correct "this" on V8Object method invocation, closes #185 2015-12-26 12:16:17 +01:00
Stefan Siegl
67a9de01bd Allow custom module normalisation 2015-12-06 13:55:13 +01:00
Stefan Siegl
bf58fe67c1 wrap module loading in zend_try/zend_catch, closes #178 2015-12-04 22:09:04 +01:00
Stefan Siegl
39fff2301e Use module id as JsFileName for V8
This way the information to V8JsScriptException instances are way
more clear since they contain the name of the module that caused
the exception.
2015-12-04 21:46:54 +01:00
Stefan Siegl
97a9a2cc74 tests/pthreads_001: don't test pthread ext internals 2015-12-04 19:22:29 +01:00
Stefan Siegl
059e0500fb Merge remote-tracking branch 'origin/master' into php7 2015-11-29 12:21:40 +01:00
Matt Kynaston
a58f944804 Experiment to see if #172 is easy to fix 2015-11-03 17:35:30 +00:00
Stefan Siegl
296b9078ff fix exception back-propagation on PHP7 2015-10-11 14:59:25 +02:00
Stefan Siegl
5cba44ccd0 Merge remote-tracking branch 'origin/master' into php7
Conflicts:
	README.md
	v8js.cc
	v8js_class.cc
	v8js_exceptions.cc
	v8js_object_export.cc
	v8js_v8.cc
	v8js_v8object_class.cc
2015-10-11 02:09:59 +02:00
Stefan Siegl
b8726409f4 Throw V8JsException if v8 context cannot be created
We used to reset This to NULL, which never reallt was supposed to work
and PHP doc explicitly tell to not touch EX(This)
2015-10-03 00:01:12 +02:00
Stefan Siegl
afa52c07bc Remove hard-coded full pathnames from test 2015-10-02 22:29:27 +02:00
Stefan Siegl
cbbce91ffd Rename constructor functions to __construct 2015-09-28 22:56:22 +02:00
Stefan Siegl
7d97c97d4c Fix multi-threading, initialize V8 only once 2015-09-26 18:58:12 +02:00
Stefan Siegl
83f51e5021 Merge pull request #156 from stesie/php-exception-behaviour
PHP->JS exception propagation
2015-09-23 19:40:23 +02:00
Stefan Siegl
8934db6dec Add v8js.compat_php_exceptions INI switch 2015-09-23 19:19:11 +02:00
Stefan Siegl
11155a6a51 PHP7 adapt: changed fatal error messages 2015-08-29 21:21:43 +02:00
Stefan Siegl
49acfc6f22 Adapt ctx_lifetime test to PHP7: changed exception handling 2015-08-29 20:19:22 +02:00
Stefan Siegl
53995ac616 Make FLAG_FORCE_ARRAY not affect V8Function objects, #closes 160 2015-08-26 18:41:38 +02:00
Stefan Siegl
790735f04a Fix tests/php_exceptions_005.phpt 2015-08-23 19:30:47 +02:00
Stefan Siegl
c033000aea Fix tests/exception_propagation_2.phpt
The test relied on weird behaviour that PHP exceptions shouldn't stop
JavaScript code execution.  Since JavaScript execution is now stopped,
the JavaScript catch handler is not executed anymore.
2015-08-23 18:05:46 +02:00
Stefan Siegl
b7dde1b1db Handle thrown PHP objects, that are no exceptions 2015-08-23 17:40:27 +02:00
Stefan Siegl
f7c33539c2 Improve PHP->JS->PHP exception back propagation 2015-08-23 15:09:21 +02:00
Stefan Siegl
462eb623b3 Allow PHP exception to JS propagation 2015-08-22 15:16:02 +02:00
Stefan Siegl
187b97060f Stop JS execution on PHP exceptions, refs #144 2015-08-21 15:55:52 +02:00
Stefan Siegl
829bac9ddc Merge pull request #150 from stesie/issue-140
Fix module caching & memory leaks
2015-08-03 08:40:26 +02:00
Stefan Siegl
441f7b7fab v8js_commonjs_split_terms: use pointer comparison instead of strlen
The strlen usage on term obviously was wrong here, since the term
string is not null-terminated at that place.
2015-08-01 19:54:23 +02:00
Stefan Siegl
ea3ec4bd65 Fix commonjs memory leaks (and increase test coverage to 100%) 2015-08-01 19:30:55 +02:00
Stefan Siegl
3324490a79 test issue_127_001.phpt doesn't depend on ext_json 2015-08-01 18:47:44 +02:00
Stefan Siegl
d8e239a756 test per isolate module cache seperation 2015-08-01 17:57:57 +02:00
Stefan Siegl
3d89f0250d Provide key compare function for modules_loaded
Without the compare function std::map simply compares one
pointer to another.  However we need to compare the actual
strings.

Besides we must not efree normalised_module_id on return
of require method, since the pointer was added to
modules_loaded (and is valid until destruction of V8Js
class); instead it is now freed during V8Js object destruction.
2015-08-01 17:49:11 +02:00
Stefan Siegl
34242c5d60 skip extensions_error test for v8 version < 3.30 2015-07-25 18:16:04 +02:00
Stefan Siegl
81018372e4 Adapt test to changed v8 error message
Added a "%s" so both messages are matched:

 * Extension or internal compilation error: MakeReferenceError in handlebars at line 1.
 * Extension or internal compilation error in handlebars at line 1.
2015-07-25 16:01:54 +02:00