From c20c19c126aade8e51bff0643dd25adc8f732a8a Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sun, 12 Nov 2017 15:28:44 +0100 Subject: [PATCH] add test so that 'this === global' --- tests/global_object_basic.phpt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/global_object_basic.phpt b/tests/global_object_basic.phpt index 862cbef..2f5a16e 100644 --- a/tests/global_object_basic.phpt +++ b/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=== \ No newline at end of file +bool(true) +===EOF===