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

Add test on property passing on generators

This commit is contained in:
Stefan Siegl 2016-01-07 23:19:31 +01:00
parent 798a87e481
commit c500d0c21e

View File

@ -0,0 +1,32 @@
--TEST--
Test V8::executeString() : Generators V8 -> PHP (properties)
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$js = <<<EOJS
function* TheGen() {
yield 23;
yield PHP.getValue();
}
var gen = TheGen();
gen.foo = 23;
gen.bar = function() { var_dump("Hello World"); };
gen;
EOJS;
$v8 = new V8Js();
$gen = $v8->executeString($js);
var_dump($gen->foo);
$gen->bar();
?>
===EOF===
--EXPECT--
int(23)
string(11) "Hello World"
===EOF===