Skip to content

Commit f6a93c3

Browse files
committed
Remove support for uncaught exceptions. Use try/catch.
1 parent fa4babb commit f6a93c3

11 files changed

+9
-364
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ class V8Js
7878
* Initializes and starts V8 engine and returns new V8Js object with it's own V8 context.
7979
* @param string $object_name
8080
* @param array $variables
81-
* @param bool $report_uncaught_exceptions
8281
* @param string $snapshot_blob
8382
*/
84-
public function __construct($object_name = "PHP", array $variables = [], $report_uncaught_exceptions = TRUE, $snapshot_blob = NULL)
83+
public function __construct($object_name = "PHP", array $variables = [], $snapshot_blob = NULL)
8584
{}
8685

8786
/**
@@ -358,8 +357,7 @@ Exceptions
358357
==========
359358

360359
If the JavaScript code throws (without catching), causes errors or doesn't
361-
compile, `V8JsScriptException` exceptions are thrown unless the `V8Js` object
362-
is constructed with `report_uncaught_exceptions` set `FALSE`.
360+
compile, `V8JsScriptException` exceptions are thrown.
363361

364362
PHP exceptions that occur due to calls from JavaScript code by default are
365363
*not* re-thrown into JavaScript context but cause the JavaScript execution to

tests/create_snapshot_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (strlen($snap) > 0) {
2222
var_dump("snapshot successfully created");
2323
}
2424

25-
$v8 = new V8Js('PHP', array(), true, $snap);
25+
$v8 = new V8Js('PHP', array(), $snap);
2626
$v8->executeString('var_dump(doublify(23));');
2727
?>
2828
===EOF===

tests/exception_clearing.phpt

Lines changed: 0 additions & 90 deletions
This file was deleted.

tests/exception_propagation_1.phpt

Lines changed: 0 additions & 37 deletions
This file was deleted.

tests/exception_propagation_2.phpt

Lines changed: 0 additions & 112 deletions
This file was deleted.

tests/exception_propagation_3.phpt

Lines changed: 0 additions & 39 deletions
This file was deleted.

tests/issue_183_003.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ var_dump(typeof PHP.executeString);
1919
var_dump(typeof PHP.compileString);
2020
var_dump(typeof PHP.executeScript);
2121
var_dump(typeof PHP.checkString);
22-
var_dump(typeof PHP.getPendingException);
2322
var_dump(typeof PHP.setModuleNormaliser);
2423
var_dump(typeof PHP.setModuleLoader);
2524
var_dump(typeof PHP.registerExtension);
@@ -52,6 +51,5 @@ string(9) "undefined"
5251
string(9) "undefined"
5352
string(9) "undefined"
5453
string(9) "undefined"
55-
string(9) "undefined"
5654
string(6) "caught"
5755
===EOF===

tests/unicode.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $unicode = 'äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█
1212
$snapshot = V8Js::createSnapshot("var snapshot = {unicode: '" . $unicode . "'}");
1313

1414
# start V8Js
15-
$jscript = new V8Js('php', array(), true, $snapshot);
15+
$jscript = new V8Js('php', array(), $snapshot);
1616

1717
# insert unicode via php var
1818
$jscript->unicode = $unicode;

0 commit comments

Comments
 (0)