diff --git a/README.md b/README.md index df8e8c3..821e9d2 100644 --- a/README.md +++ b/README.md @@ -414,10 +414,3 @@ objects obeying the above rules and re-thrown in JavaScript context. If they are not caught by JavaScript code the execution stops and a `V8JsScriptException` is thrown, which has the original PHP exception accessible via `getPrevious` method. - -V8Js versions 0.2.4 and before did not stop JS code execution on PHP exceptions, -but silently ignored them (even so succeeding PHP calls from within the same piece -of JS code were not executed by the PHP engine). This behaviour is considered as -a bug and hence was fixed with 0.2.5 release. Nevertheless there is a -compatibility php.ini switch (`v8js.compat_php_exceptions`) which turns previous -behaviour back on. diff --git a/php_v8js_macros.h b/php_v8js_macros.h index 4ab3a94..c0a759a 100644 --- a/php_v8js_macros.h +++ b/php_v8js_macros.h @@ -113,7 +113,6 @@ ZEND_BEGIN_MODULE_GLOBALS(v8js) /* Ini globals */ bool use_date; /* Generate JS Date objects instead of PHP DateTime */ bool use_array_access; /* Convert ArrayAccess, Countable objects to array-like objects */ - bool compat_php_exceptions; /* Don't stop JS execution on PHP exception */ // Timer thread globals std::deque timer_stack; diff --git a/tests/issue_156_001.phpt b/tests/issue_156_001.phpt deleted file mode 100644 index dc9ed68..0000000 --- a/tests/issue_156_001.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Test V8::executeString() : Backwards compatibility for issue #156 ---SKIPIF-- - ---INI-- -v8js.compat_php_exceptions = 1 ---FILE-- -throwPHPException = function () { - echo "throwing PHP exception now ...\n"; - throw new \Exception('foo'); -}; - -$JS = <<< EOT -PHP.throwPHPException(); -print("... old behaviour was to not stop JS execution on PHP exceptions\\n"); -EOT; - -try { - $v8->executeString($JS, 'issue_156_001.js'); -} catch(Exception $e) { - var_dump($e->getMessage()); -} -?> -===EOF=== ---EXPECT-- -throwing PHP exception now ... -... old behaviour was to not stop JS execution on PHP exceptions -string(3) "foo" -===EOF=== diff --git a/v8js_main.cc b/v8js_main.cc index bc60ba9..66b58ef 100644 --- a/v8js_main.cc +++ b/v8js_main.cc @@ -112,19 +112,11 @@ static ZEND_INI_MH(v8js_OnUpdateUseArrayAccess) /* {{{ */ } /* }}} */ -static ZEND_INI_MH(v8js_OnUpdateCompatExceptions) /* {{{ */ -{ - V8JSG(compat_php_exceptions) = v8js_ini_to_bool(new_value); - return SUCCESS; -} -/* }}} */ - ZEND_INI_BEGIN() /* {{{ */ ZEND_INI_ENTRY("v8js.flags", NULL, ZEND_INI_ALL, v8js_OnUpdateV8Flags) ZEND_INI_ENTRY("v8js.icudtl_dat_path", NULL, ZEND_INI_ALL, v8js_OnUpdateIcudatPath) ZEND_INI_ENTRY("v8js.use_date", "0", ZEND_INI_ALL, v8js_OnUpdateUseDate) ZEND_INI_ENTRY("v8js.use_array_access", "0", ZEND_INI_ALL, v8js_OnUpdateUseArrayAccess) - ZEND_INI_ENTRY("v8js.compat_php_exceptions", "0", ZEND_INI_ALL, v8js_OnUpdateCompatExceptions) ZEND_INI_END() /* }}} */ diff --git a/v8js_object_export.cc b/v8js_object_export.cc index 7516f30..4d61e76 100644 --- a/v8js_object_export.cc +++ b/v8js_object_export.cc @@ -162,7 +162,7 @@ failure: efree(fci.params); } - if(EG(exception) && !V8JSG(compat_php_exceptions)) { + if(EG(exception)) { if(ctx->flags & V8JS_FLAG_PROPAGATE_PHP_EXCEPTIONS) { zval tmp_zv; ZVAL_OBJ(&tmp_zv, EG(exception));