mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-08 22:11:52 +00:00
Test exception branch of php_v8js_v8_has_property.
This commit is contained in:
parent
51930e7bca
commit
492f87cd5b
38
tests/has_property_after_dispose.phpt
Normal file
38
tests/has_property_after_dispose.phpt
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
--TEST--
|
||||||
|
Test V8::executeString() : has_property after dispose
|
||||||
|
--SKIPIF--
|
||||||
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Foo {
|
||||||
|
function callMe($x) {
|
||||||
|
var_dump(property_exists($x, 'bla'));
|
||||||
|
$this->x = $x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$v8 = new V8Js();
|
||||||
|
$v8->foo = $foo = new Foo();
|
||||||
|
|
||||||
|
$JS = <<< EOT
|
||||||
|
PHP.foo.callMe({ bla: 23 });
|
||||||
|
|
||||||
|
EOT;
|
||||||
|
|
||||||
|
$v8->executeString($JS, 'basic.js');
|
||||||
|
unset($v8);
|
||||||
|
|
||||||
|
try {
|
||||||
|
var_dump(property_exists($foo->x, 'bla'));
|
||||||
|
}
|
||||||
|
catch(V8JsScriptException $e) {
|
||||||
|
var_dump($e->getMessage());
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
===EOF===
|
||||||
|
--EXPECTF--
|
||||||
|
bool(true)
|
||||||
|
string(55) "Can't access V8Object after V8Js instance is destroyed!"
|
||||||
|
===EOF===
|
||||||
|
|
Loading…
Reference in New Issue
Block a user