Explorar o código

add test so that 'this === global'

Stefan Siegl %!s(int64=7) %!d(string=hai) anos
pai
achega
c20c19c126
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      tests/global_object_basic.phpt

+ 6 - 1
tests/global_object_basic.phpt

@@ -8,6 +8,10 @@ Test V8Js::executeString : Global scope links global object
 $JS = <<< EOT
 var_dump(typeof global);
 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;
 
 $v8 = new V8Js();
@@ -17,4 +21,5 @@ $v8->executeString($JS);
 --EXPECT--
 string(6) "object"
 bool(true)
-===EOF===
+bool(true)
+===EOF===