0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-11-09 16:28:41 +00:00

Merge pull request #331 from stesie/mark-pending-exceptions-deprecated

Mark pending exceptions deprecated
This commit is contained in:
Stefan Siegl 2017-09-25 15:08:33 +02:00 committed by GitHub
commit 3afd98ba3a
4 changed files with 24 additions and 3 deletions

View File

@ -21,8 +21,17 @@ var_dump($v8->getPendingException());
?>
===EOF===
--EXPECTF--
Deprecated: V8Js::__construct(): Disabling exception reporting is deprecated, $report_uncaught_exceptions != true in %s%eexception_clearing.php on line 3
Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_clearing.php on line 5
NULL
Deprecated: Function V8Js::clearPendingException() is deprecated in %s%eexception_clearing.php on line 7
Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_clearing.php on line 8
NULL
Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_clearing.php on line 11
object(V8JsScriptException)#%d (13) {
["message":protected]=>
string(49) "throw_0:1: ReferenceError: fooobar is not defined"
@ -73,5 +82,9 @@ object(V8JsScriptException)#%d (13) {
string(57) "ReferenceError: fooobar is not defined
at throw_0:1:1"
}
Deprecated: Function V8Js::clearPendingException() is deprecated in %s%eexception_clearing.php on line 13
Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_clearing.php on line 14
NULL
===EOF===

View File

@ -38,6 +38,9 @@ try {
?>
===EOF===
--EXPECTF--
Deprecated: V8Js::__construct(): Disabling exception reporting is deprecated, $report_uncaught_exceptions != true in %s%eexception_propagation_2.php on line 8
Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_propagation_2.php on line 11
object(V8JsScriptException)#%d (13) {
["message":protected]=>
string(49) "throw_0:1: ReferenceError: fooobar is not defined"

View File

@ -31,7 +31,8 @@ try {
}
?>
===EOF===
--EXPECT--
--EXPECTF--
Deprecated: V8Js::__construct(): Disabling exception reporting is deprecated, $report_uncaught_exceptions != true in %s%eexception_propagation_3.php on line 8
SyntaxError caught in JS!
To Bar!
Error caught via PHP callback!

View File

@ -357,6 +357,10 @@ static PHP_METHOD(V8Js, __construct)
ZVAL_NULL(&c->pending_exception);
c->in_execution = 0;
if (report_uncaught != 1) {
php_error_docref(NULL, E_DEPRECATED, "Disabling exception reporting is deprecated, $report_uncaught_exceptions != true");
}
new (&c->create_params) v8::Isolate::CreateParams();
#ifdef USE_INTERNAL_ALLOCATOR
@ -1265,8 +1269,8 @@ const zend_function_entry v8js_methods[] = { /* {{{ */
PHP_ME(V8Js, compileString, arginfo_v8js_compilestring, ZEND_ACC_PUBLIC)
PHP_ME(V8Js, executeScript, arginfo_v8js_executescript, ZEND_ACC_PUBLIC)
PHP_ME(V8Js, checkString, arginfo_v8js_checkstring, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
PHP_ME(V8Js, getPendingException, arginfo_v8js_getpendingexception, ZEND_ACC_PUBLIC)
PHP_ME(V8Js, clearPendingException, arginfo_v8js_clearpendingexception, ZEND_ACC_PUBLIC)
PHP_ME(V8Js, getPendingException, arginfo_v8js_getpendingexception, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
PHP_ME(V8Js, clearPendingException, arginfo_v8js_clearpendingexception, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
PHP_ME(V8Js, setModuleNormaliser, arginfo_v8js_setmodulenormaliser, ZEND_ACC_PUBLIC)
PHP_ME(V8Js, setModuleLoader, arginfo_v8js_setmoduleloader, ZEND_ACC_PUBLIC)
PHP_ME(V8Js, setTimeLimit, arginfo_v8js_settimelimit, ZEND_ACC_PUBLIC)