Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Tests were using delete global.WebAssembly to simulate unavailable features, which throws in strict mode on engines where WebAssembly is non-configurable.

Changes:

  • Replace delete global.WebAssembly with global.WebAssembly = undefined (5 occurrences)
  • Replace delete global.SharedArrayBuffer with global.SharedArrayBuffer = undefined (1 occurrence)

Example:

// Before
it('returns not supported when WebAssembly is unavailable', () => {
  delete global.WebAssembly;  // Throws on some engines
  const result = detectClientSideMediaSupport();
  expect(result.supported).toBe(false);
});

// After
it('returns not supported when WebAssembly is unavailable', () => {
  global.WebAssembly = undefined;  // Safe assignment
  const result = detectClientSideMediaSupport();
  expect(result.supported).toBe(false);
});

The afterEach hook already restores original values, maintaining test isolation.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link
Contributor Author

Copilot AI commented Jan 27, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • translate.wordpress.org
    • Triggering command: /usr/local/bin/node node i18n-cache/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update WebAssembly support detection and fallbacks implementation Replace unsafe delete operations in WebAssembly feature detection tests Jan 27, 2026
Copilot AI requested a review from adamsilverstein January 27, 2026 21:20
@github-actions
Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@adamsilverstein adamsilverstein marked this pull request as ready for review January 27, 2026 21:25
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @Copilot.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: Copilot.


To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@adamsilverstein adamsilverstein merged commit a165583 into 74365-wasm-detection Jan 27, 2026
36 of 38 checks passed
@adamsilverstein adamsilverstein deleted the copilot/sub-pr-74827-one-more-time branch January 27, 2026 21:25
adamsilverstein added a commit that referenced this pull request Feb 3, 2026
…ts (#74993)

* Initial plan

* Replace unsafe delete operations with property assignments

Co-authored-by: adamsilverstein <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: adamsilverstein <[email protected]>
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