-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript ShadowRealm proposal integration #9893
Open
Ms2ger
wants to merge
46
commits into
whatwg:main
Choose a base branch
from
Ms2ger:realms
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
afc1353
Editorial: make 'module type allowed' take a realm
Ms2ger 002d9fa
Editorial: replace the settings object field in scripts by a realm field
Ms2ger 3d1c1f2
Editorial: redefine scripting enabled/disabled in terms of realms
Ms2ger b49562c
Editorial: create CSS/JSON modules with realm
Ms2ger f1dbdc6
Editorial: create JS modules with realm
Ms2ger 50f5d5c
Editorial: create WebAssembly modules with realm
Ms2ger e14e94d
Editorial: use a realm in resolve a module specifier
Ms2ger d5286dc
Editorial: pass a realm to 'creating a classic script'
Ms2ger 9e9543b
Editorial: use realms in check if we can run script
Ms2ger 1beeb82
Editorial: don't go through the settings object to report an exceptio…
Ms2ger 84c282f
Editorial: use realms in prepare to run script/clean up after running…
Ms2ger 698addf
Editorial: use realms around 'incumbent'
Ms2ger eba56c6
Editorial: use realm in HostPromiseRejectionTracker
Ms2ger dbd4eef
JavaScript ShadowRealm proposal integration
Ms2ger e976653
Fetch modules directly for ShadowRealms
Ms2ger 8131d27
Start defining ShadowRealmGlobalObject
Ms2ger 4fc8be2
Add link
Ms2ger 5990402
Review
Ms2ger 6e859ee
Better layering for the mutable global prototype chain
Ms2ger 06b190b
Rephrase
Ms2ger f788ca6
Add context argument to HostInitializeShadowRealm
Ms2ger 097b31b
Rename ShadowRealmGlobalObject
Ms2ger 8f37b91
Add atob, btoa, structuredClone to shadow realms
Ms2ger d8e1594
Add queueMicrotask
Ms2ger 20bae79
Indentation
Ms2ger b1021fe
Rename WindowOrWorkerOrShadowRealmGlobalScope to UniversalGlobalScope
Ms2ger 01e83bb
review
Ms2ger 0dc0ee4
Review
Ms2ger 9e48745
review
Ms2ger ea3c573
Restructure HostInitializeShadowRealm
Ms2ger 7660208
Indentation
Ms2ger f5194b0
Fix
Ms2ger 873cd6d
Remove unnecessary concept
Ms2ger f896319
queueing
Ms2ger eff546f
Better guidance and sectioning
Ms2ger dc9fddc
Improve the global object creation
Ms2ger f0e4ee6
Rephrase
nicolo-ribaudo c8d1b45
address comment
Ms2ger a12d85e
Note
Ms2ger 2039fa1
link ShadowRealmGlobalScope
Ms2ger 0f65b04
event handlers
Ms2ger 9aece76
Add reportError
Ms2ger 8cf3150
isSecureContext
Ms2ger acb7665
Fix base url in module specifier resolution
Ms2ger 7449ee0
Fix HostInitializeShadowRealm
Ms2ger a2fe477
relevant principal *
Ms2ger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
event handlers
- Loading branch information
commit 0f65b040ee228014eb33885a679721bf23054b2e
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally preferred the old steps for global object creation before dc9fddc as the steps if followed explicitly were more easily implementable without needing to add web specific changes into the javascript implementation. There is no clear hook for
InitializeHostDefinedRealm
to say that it is being invoked in the ShadowRealm constructor.I think this type of customization should ideally be explicitly stated at the call site of
HostInitializeShadowRealm
, similar to how https://whatpr.org/html/9893/webappapis.html#creating-a-new-javascript-realm does where it is used like:What makes this awkward is that
HostInitializeShadowRealm
is being invoked in JS spec, where we would like to make that customization.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's not great in terms of layering. I'm hoping tc39/ecma262#3497 and tc39/ecma262#3274 will get us somewhere better, and then we can do an editorial change to adjust to that.