Skip to content

Commit 82930c9

Browse files
committed
Create deprecated warning if setting $report_uncaught_exceptions != true
1 parent 56e83a9 commit 82930c9

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

tests/exception_clearing.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ var_dump($v8->getPendingException());
2121
?>
2222
===EOF===
2323
--EXPECTF--
24+
Deprecated: V8Js::__construct(): Disabling exception reporting is deprecated, $report_uncaught_exceptions != true in %s%eexception_clearing.php on line 3
25+
2426
Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_clearing.php on line 5
2527
NULL
2628

tests/exception_propagation_2.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ try {
3838
?>
3939
===EOF===
4040
--EXPECTF--
41+
Deprecated: V8Js::__construct(): Disabling exception reporting is deprecated, $report_uncaught_exceptions != true in %s%eexception_propagation_2.php on line 8
42+
4143
Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_propagation_2.php on line 11
4244
object(V8JsScriptException)#%d (13) {
4345
["message":protected]=>

tests/exception_propagation_3.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ try {
3131
}
3232
?>
3333
===EOF===
34-
--EXPECT--
34+
--EXPECTF--
35+
Deprecated: V8Js::__construct(): Disabling exception reporting is deprecated, $report_uncaught_exceptions != true in %s%eexception_propagation_3.php on line 8
3536
SyntaxError caught in JS!
3637
To Bar!
3738
Error caught via PHP callback!

v8js_class.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ static PHP_METHOD(V8Js, __construct)
357357
ZVAL_NULL(&c->pending_exception);
358358
c->in_execution = 0;
359359

360+
if (report_uncaught != 1) {
361+
php_error_docref(NULL, E_DEPRECATED, "Disabling exception reporting is deprecated, $report_uncaught_exceptions != true");
362+
}
363+
360364
new (&c->create_params) v8::Isolate::CreateParams();
361365

362366
#ifdef USE_INTERNAL_ALLOCATOR

0 commit comments

Comments
 (0)