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

Add test on fatal errors within JS generators

This commit is contained in:
Stefan Siegl 2016-01-07 23:16:59 +01:00
parent 46fba810af
commit 798a87e481

View File

@ -0,0 +1,32 @@
--TEST--
Test V8::executeString() : Generators V8 -> PHP (fatal error)
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$js = <<<EOJS
function* TheGen() {
yield 23;
yield PHP.getValue();
}
TheGen();
EOJS;
$v8 = new V8Js();
$v8->getValue = function() {
trigger_error("you're gonna fail now", E_USER_ERROR);
};
$gen = $v8->executeString($js);
foreach($gen as $a) {
var_dump($a);
}
?>
===EOF===
--EXPECTF--
int(23)
Fatal error: you're gonna fail now in %s