2014-12-09 21:20:34 +00:00
|
|
|
--TEST--
|
|
|
|
Test V8Function() : Handle fatal errors gracefully
|
|
|
|
--SKIPIF--
|
|
|
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class Foo {
|
|
|
|
function callback() {
|
|
|
|
echo "goodbye cruel world!\n";
|
|
|
|
$this->bar(); // trigger fatal error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$sandbox = new V8Js();
|
|
|
|
$sandbox->foo = new Foo();
|
|
|
|
|
|
|
|
$cb = $sandbox->executeString('(function() { PHP.foo.callback(); });');
|
|
|
|
$cb();
|
|
|
|
|
|
|
|
?>
|
|
|
|
===EOF===
|
|
|
|
--EXPECTF--
|
|
|
|
goodbye cruel world!
|
|
|
|
|
2015-08-29 19:21:43 +00:00
|
|
|
Fatal error: Uncaught Error: Call to undefined method Foo::bar() in %s%efatal_error_v8function.php:6
|
|
|
|
Stack trace:
|
2021-08-20 12:08:45 +00:00
|
|
|
#0 %s: Foo->callback()
|
2015-08-29 19:21:43 +00:00
|
|
|
#1 %s%efatal_error_v8function.php(14): V8Function->V8Js::V8::Invoke()
|
|
|
|
#2 {main}
|
|
|
|
thrown in %s%efatal_error_v8function.php on line 6
|