0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 14:01:53 +00:00

add test so that 'this === global'

This commit is contained in:
Stefan Siegl 2017-11-12 15:28:44 +01:00
parent e4ab07de03
commit c20c19c126
No known key found for this signature in database
GPG Key ID: 73942AF5642F3DDA

View File

@ -8,6 +8,10 @@ Test V8Js::executeString : Global scope links global object
$JS = <<< EOT $JS = <<< EOT
var_dump(typeof global); var_dump(typeof global);
var_dump(global.var_dump === var_dump); var_dump(global.var_dump === var_dump);
// also this is equal to global scope, at least in global execution context
// (i.e. off modules)
var_dump(this === global);
EOT; EOT;
$v8 = new V8Js(); $v8 = new V8Js();
@ -17,4 +21,5 @@ $v8->executeString($JS);
--EXPECT-- --EXPECT--
string(6) "object" string(6) "object"
bool(true) bool(true)
bool(true)
===EOF=== ===EOF===