Bug 165171 - Add support for globalThis
Summary: Add support for globalThis
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords: InRadar
: 186785 (view as bug list)
Depends on: 166915
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-29 16:12 PST by Keith Miller
Modified: 2019-02-03 19:28 PST (History)
15 users (show)

See Also:


Attachments
Patch (3.17 KB, patch)
2016-11-29 16:18 PST, Keith Miller
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-yosemite (1.34 MB, application/zip)
2016-11-29 17:12 PST, Build Bot
no flags Details
Archive of layout-test-results from ews126 for ios-simulator-wk2 (12.23 MB, application/zip)
2016-11-29 17:29 PST, Build Bot
no flags Details
Archive of layout-test-results from ews114 for mac-yosemite (1.75 MB, application/zip)
2016-11-29 17:35 PST, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (1.24 MB, application/zip)
2016-11-29 22:16 PST, Build Bot
no flags Details
Patch for landing (13.73 KB, patch)
2016-12-20 18:34 PST, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (2.95 KB, patch)
2018-12-20 12:19 PST, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (3.16 KB, patch)
2018-12-20 12:21 PST, Keith Miller
no flags Details | Formatted Diff | Diff
Patch for landing (4.85 KB, patch)
2018-12-20 13:01 PST, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2016-11-29 16:12:38 PST
Add support for global
Comment 1 Keith Miller 2016-11-29 16:18:15 PST
Created attachment 295668 [details]
Patch
Comment 2 Build Bot 2016-11-29 17:12:11 PST
Comment on attachment 295668 [details]
Patch

Attachment 295668 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/2591732

New failing tests:
js/dom/getOwnPropertyDescriptor.html
Comment 3 Build Bot 2016-11-29 17:12:14 PST
Created attachment 295677 [details]
Archive of layout-test-results from ews102 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-11-29 17:29:21 PST
Comment on attachment 295668 [details]
Patch

Attachment 295668 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/2591771

New failing tests:
js/dom/getOwnPropertyDescriptor.html
Comment 5 Build Bot 2016-11-29 17:29:24 PST
Created attachment 295680 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 6 Build Bot 2016-11-29 17:35:06 PST
Comment on attachment 295668 [details]
Patch

Attachment 295668 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2591813

New failing tests:
js/dom/getOwnPropertyDescriptor.html
Comment 7 Build Bot 2016-11-29 17:35:09 PST
Created attachment 295682 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 8 Build Bot 2016-11-29 22:16:54 PST
Comment on attachment 295668 [details]
Patch

Attachment 295668 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/2593202

New failing tests:
js/dom/getOwnPropertyDescriptor.html
Comment 9 Build Bot 2016-11-29 22:16:57 PST
Created attachment 295703 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 10 Jordan Harband 2016-12-20 17:32:00 PST
Any update here? :-D
Comment 11 Keith Miller 2016-12-20 18:24:32 PST
(In reply to comment #10)
> Any update here? :-D

Whoops, totally forgot about this patch. I'll fix the test and cq again.
Comment 12 Keith Miller 2016-12-20 18:34:10 PST
Created attachment 297576 [details]
Patch for landing
Comment 13 WebKit Commit Bot 2016-12-20 20:05:32 PST
Comment on attachment 297576 [details]
Patch for landing

Clearing flags on attachment: 297576

Committed r210052: <http://trac.webkit.org/changeset/210052>
Comment 14 WebKit Commit Bot 2016-12-20 20:05:36 PST
All reviewed patches have been landed.  Closing bug.
Comment 15 Radar WebKit Bug Importer 2016-12-21 20:55:26 PST
<rdar://problem/29782794>
Comment 16 Sergey Rubanov 2017-01-03 09:24:57 PST
Any info on next WebKit Nightly release date? Last release was 2 weeks ago
Comment 17 Lucas Forschler 2017-01-03 13:41:24 PST
The WebKit nightly builder was having an issue. I have kicked off a new build, and will watch its progress.
Comment 18 Lucas Forschler 2017-01-03 16:54:54 PST
r210247.dmg">https://builds-nightly.webkit.org/files/trunk/mac/WebKit-SVN-r210247.dmg
Comment 19 WebKit Commit Bot 2017-01-10 17:34:07 PST
Re-opened since this is blocked by bug 166915
Comment 20 Sergey Rubanov 2017-01-11 10:18:37 PST
This was (mistakenly?) landed to Safari TP 21
Comment 21 Jordan Harband 2017-01-11 13:12:29 PST
Not mistakenly - it predates the web compat issues that popped up.

It should be reverted, but any web compat issues learned about via TP 21 would be very helpful.
Comment 22 Ryosuke Niwa 2017-01-11 14:45:59 PST
We had to rollout this feature it broke Polymer tests.
Comment 24 Jordan Harband 2018-12-18 20:14:47 PST
The identifier is now named `globalThis`; Chrome is already shipping it. Can this get another shot? :-)
Comment 25 Keith Miller 2018-12-19 13:40:20 PST
(In reply to Jordan Harband from comment #24)
> The identifier is now named `globalThis`; Chrome is already shipping it. Can
> this get another shot? :-)

Sure, I forgot about this. Will upload a patch shortly.
Comment 26 Keith Miller 2018-12-20 12:19:16 PST
Created attachment 357848 [details]
Patch
Comment 27 Keith Miller 2018-12-20 12:21:56 PST
Created attachment 357849 [details]
Patch
Comment 28 Saam Barati 2018-12-20 12:22:34 PST
Comment on attachment 357849 [details]
Patch

Can you add a layout test asserting this is === window?
Comment 29 Mark Lam 2018-12-20 12:25:23 PST
Comment on attachment 357849 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=357849&action=review

> Source/JavaScriptCore/ChangeLog:8
> +        This patch adds spport for the globalThis property on the global

spport => support
Comment 30 Keith Miller 2018-12-20 12:43:22 PST
(In reply to Saam Barati from comment #28)
> Comment on attachment 357849 [details]
> Patch
> 
> Can you add a layout test asserting this is === window?

Sounds good!
Comment 31 Keith Miller 2018-12-20 13:01:08 PST
Created attachment 357852 [details]
Patch for landing
Comment 32 WebKit Commit Bot 2018-12-20 13:39:20 PST
Comment on attachment 357852 [details]
Patch for landing

Clearing flags on attachment: 357852

Committed r239464: <https://trac.webkit.org/changeset/239464>
Comment 33 WebKit Commit Bot 2018-12-20 13:39:22 PST
All reviewed patches have been landed.  Closing bug.
Comment 34 Saam Barati 2018-12-20 14:34:19 PST
Comment on attachment 357852 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=357852&action=review

> LayoutTests/js/globalThis-is-window.html:13
> +// testRunner.waitUntilDone();

oops
Comment 35 Saam Barati 2018-12-20 14:35:14 PST
Comment on attachment 357852 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=357852&action=review

> Source/JavaScriptCore/runtime/JSGlobalObject.cpp:305
> +  globalThis            JSGlobalObject::m_globalThis                 DontEnum|CellProperty

We should add tests where we
- delete this property
- ensure its not enumerable
if such tests aren't in test262 already
Comment 37 Jordan Harband 2019-01-09 11:35:02 PST
Any idea why adding a global identifier would cause a test failure?

It might be notable that `jsc` has no identifier for the global object prior to this feature (although it's still accessible via `Function('return this')()`). Could that be causing issues?
Comment 38 Ross Kirsling 2019-02-03 19:28:04 PST
*** Bug 186785 has been marked as a duplicate of this bug. ***