mirror of
https://github.com/phpv8/v8js.git
synced 2024-11-08 20:08:41 +00:00
39 lines
540 B
Plaintext
39 lines
540 B
Plaintext
|
--TEST--
|
||
|
Test V8::executeString() : test context separation
|
||
|
--SKIPIF--
|
||
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
$JS = <<< EOT
|
||
|
print(PHP.foo);
|
||
|
EOT;
|
||
|
|
||
|
$a = new V8Js();
|
||
|
$a->foo = 'from first.js';
|
||
|
|
||
|
try {
|
||
|
$a->executeString($JS, 'first.js');
|
||
|
} catch (V8JsException $e) {
|
||
|
var_dump($e);
|
||
|
}
|
||
|
|
||
|
echo "\n";
|
||
|
|
||
|
$b = new V8Js();
|
||
|
$b->foo = 'from second.js';
|
||
|
|
||
|
try {
|
||
|
$b->executeString($JS, 'second.js');
|
||
|
} catch (V8JsException $e) {
|
||
|
var_dump($e);
|
||
|
}
|
||
|
|
||
|
echo "\n";
|
||
|
?>
|
||
|
===EOF===
|
||
|
--EXPECTF--
|
||
|
from first.js
|
||
|
from second.js
|
||
|
===EOF===
|