Skip to content
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

chore: remove 'as *' imports because of esModuleInterop: true #34854

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Feb 19, 2025

Turns out neither as * nor without is an import without any hacks. Its either wrapped in _interopRequireWildcard or in the _interopRequireDefault function. See:

function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }

This PR changes it back to how it was with the simpler wrapping function which makes the code in the docs and //packages more readable.

This comment has been minimized.

@mxschmitt mxschmitt requested a review from Skn0tt February 19, 2025 12:07
Copy link
Contributor

Test results for "tests 1"

6 flaky ⚠️ [chromium-library] › tests/library/chromium/oopif.spec.ts:284:3 › should click @chromium-ubuntu-22.04-node22
⚠️ [firefox-page] › tests/page/page-evaluate.spec.ts:403:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [chromium-page] › tests/page/page-event-popup.spec.ts:149:3 › should not treat navigations as new popups @ubuntu-20.04-chromium-tip-of-tree
⚠️ [webkit-library] › tests/library/browsercontext-clearcookies.spec.ts:146:3 › should remove cookies by name and domain @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › tests/library/selector-generator.spec.ts:467:5 › selector generator › should generate label selector @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › tests/library/trace-viewer.spec.ts:109:1 › should show tracing.group in the action list with location @webkit-ubuntu-22.04-node18

38572 passed, 794 skipped
✔️✔️✔️

Merge workflow run.

@mxschmitt mxschmitt merged commit 3584e72 into microsoft:main Feb 19, 2025
28 of 31 checks passed
@mxschmitt mxschmitt deleted the esModuleInterop branch February 19, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants