-
-
Notifications
You must be signed in to change notification settings - Fork 68
fix: change globalObject to globalThis
#579
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
Conversation
In ESM `this` is undefined at the top level. Instead to access the global object you must use `globalThis`.
Hmm. Although this should probably be okay, could Deno use the ESM version of webidl2.js inside idlharness instead? |
As you know the UMD version of webidl2.js is vendored into the wpt repo at https://github.com/web-platform-tests/wpt/blob/master/resources/webidl2/lib/webidl2.js. We could float a patch adjusting how idlharness tests are handled in our wpt fork (https://github.com/denoland/wpt), but this would require significant changes to |
For reference, the way we run the tests are to fetch the HTML page from |
My concern is that this is a syntactic breaking change, but I guess it should be okay as we expect this to run mainly on latest JS engines.
I hope WPT ultimately migrate to ESM, so I'd say it's kinda worth it 😄 |
Since there already is a pending breaking change, let's merge this and see how it goes. |
Pulls in w3c/webidl2.js#579 for Deno.
Pulls in w3c/webidl2.js#579 for Deno.
…estonly Automatic update from web-platform-tests chore: update webidl2.js to v24.1.1 (#29238) Pulls in w3c/webidl2.js#579 for Deno. -- wpt-commits: 0c0ec487597b6e83f94089ddcef6df854239b10d wpt-pr: 29238
…estonly Automatic update from web-platform-tests chore: update webidl2.js to v24.1.1 (#29238) Pulls in w3c/webidl2.js#579 for Deno. -- wpt-commits: 0c0ec487597b6e83f94089ddcef6df854239b10d wpt-pr: 29238
In ESM
this
is undefined at the top level. Instead to access the global object you must useglobalThis
.This is causing some issues in Deno when running WPT idlharness tests, because all code is always executed in a module context.