Title: [239464] trunk
Revision
239464
Author
[email protected]
Date
2018-12-20 13:39:11 -0800 (Thu, 20 Dec 2018)

Log Message

Add support for globalThis
https://bugs.webkit.org/show_bug.cgi?id=165171

Reviewed by Mark Lam.

JSTests:

* test262/config.yaml:

Source/_javascript_Core:

This patch adds support for the globalThis property on the global
object. The globalThis property spec is in stage three and is
quite simple. For reference: http://tc39.github.io/proposal-global/

* runtime/JSGlobalObject.cpp:

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (239463 => 239464)


--- trunk/JSTests/ChangeLog	2018-12-20 21:18:54 UTC (rev 239463)
+++ trunk/JSTests/ChangeLog	2018-12-20 21:39:11 UTC (rev 239464)
@@ -1,3 +1,12 @@
+2018-12-20  Keith Miller  <[email protected]>
+
+        Add support for globalThis
+        https://bugs.webkit.org/show_bug.cgi?id=165171
+
+        Reviewed by Mark Lam.
+
+        * test262/config.yaml:
+
 2018-12-19  Keith Miller  <[email protected]>
 
         Update test262 configuration to not run tests dependent on ICU version.

Modified: trunk/JSTests/test262/config.yaml (239463 => 239464)


--- trunk/JSTests/test262/config.yaml	2018-12-20 21:18:54 UTC (rev 239463)
+++ trunk/JSTests/test262/config.yaml	2018-12-20 21:39:11 UTC (rev 239464)
@@ -48,10 +48,6 @@
     # https://bugs.webkit.org/show_bug.cgi?id=186691
     - test/built-ins/Reflect/ownKeys/return-on-corresponding-order-large-index.js
 
-    # https://bugs.webkit.org/show_bug.cgi?id=186785
-    - test/built-ins/global/global-object.js
-    - test/built-ins/global/property-descriptor.js
-
     # https://bugs.webkit.org/show_bug.cgi?id=192920
     - test/intl402/PluralRules/prototype/resolvedOptions/order.js
     - test/intl402/PluralRules/prototype/resolvedOptions/pluralCategories.js

Added: trunk/LayoutTests/js/globalThis-is-window-expected.txt (0 => 239464)


--- trunk/LayoutTests/js/globalThis-is-window-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/globalThis-is-window-expected.txt	2018-12-20 21:39:11 UTC (rev 239464)
@@ -0,0 +1,11 @@
+This test checks that the globalThis property is the same as the window object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS globalThis is window
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS globalThis is window
+

Added: trunk/LayoutTests/js/globalThis-is-window.html (0 => 239464)


--- trunk/LayoutTests/js/globalThis-is-window.html	                        (rev 0)
+++ trunk/LayoutTests/js/globalThis-is-window.html	2018-12-20 21:39:11 UTC (rev 239464)
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+
+description(
+    "This test checks that the globalThis property is the same as the window object"
+);
+
+// testRunner.waitUntilDone();
+
+shouldBe("globalThis", "window");
+if (globalThis !== window)
+    testFailed("globalThis !== window in the global scope");
+
+if (eval("globalThis !== window"))
+    testFailed("globalThis !== window in an eval scope");
+
+</script>
+
+<script type="module">
+shouldBe("globalThis", "window");
+if (globalThis !== window)
+    testFailed("globalThis !== window in the global module scope");
+
+if (eval("globalThis !== window"))
+    testFailed("globalThis !== window in an eval module scope");
+</script>
+
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/_javascript_Core/ChangeLog (239463 => 239464)


--- trunk/Source/_javascript_Core/ChangeLog	2018-12-20 21:18:54 UTC (rev 239463)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-12-20 21:39:11 UTC (rev 239464)
@@ -1,3 +1,16 @@
+2018-12-20  Keith Miller  <[email protected]>
+
+        Add support for globalThis
+        https://bugs.webkit.org/show_bug.cgi?id=165171
+
+        Reviewed by Mark Lam.
+
+        This patch adds support for the globalThis property on the global
+        object. The globalThis property spec is in stage three and is
+        quite simple. For reference: http://tc39.github.io/proposal-global/
+
+        * runtime/JSGlobalObject.cpp:
+
 2018-12-20  Chris Dumez  <[email protected]>
 
         Use Optional::valueOr() instead of Optional::value_or()

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (239463 => 239464)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2018-12-20 21:18:54 UTC (rev 239463)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2018-12-20 21:39:11 UTC (rev 239464)
@@ -302,6 +302,7 @@
   encodeURI             globalFuncEncodeURI                          DontEnum|Function 1
   encodeURIComponent    globalFuncEncodeURIComponent                 DontEnum|Function 1
   EvalError             JSGlobalObject::m_evalErrorConstructor       DontEnum|CellProperty
+  globalThis            JSGlobalObject::m_globalThis                 DontEnum|CellProperty
   ReferenceError        JSGlobalObject::m_referenceErrorConstructor  DontEnum|CellProperty
   SyntaxError           JSGlobalObject::m_syntaxErrorConstructor     DontEnum|CellProperty
   URIError              JSGlobalObject::m_URIErrorConstructor        DontEnum|CellProperty
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to