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

fix(compat-table): refine Destructuring support status #3179

Merged
merged 3 commits into from Jun 25, 2023

Conversation

ArrayZoneYour
Copy link
Contributor

https://kangax.github.io/compat-table/es6/

Destructuring is not fully supported in SF & Hermes, fix compat-table.js bug to correct it.

image

@evanw
Copy link
Owner

evanw commented Jun 25, 2023

Thanks for the PR. Not supporting destructuring for Safari would be unfortunate. The failing test case for Safari looks like this:

var f = function f([id, id]) { return id }

But that is always a compile error in esbuild:

✘ [ERROR] "id" cannot be bound multiple times in the same parameter list

    <stdin>:6:26:
      6 │   var f = function f([id, id]) { return id }
        ╵                           ~~

  The name "id" was originally bound here:

    <stdin>:6:22:
      6 │   var f = function f([id, id]) { return id }
        ╵                       ~~

So I should probably just ignore that test entirely since it's impossible to hit this case when using esbuild.

The other test case for Hermes is not something that esbuild generates a compile error for since it's a run-time failure (a TDZ check), so I'll keep that test enabled. If you want to use destructuring with esbuild for Hermes before Hermes fixes this failing test, you can still force esbuild to accept your code anyway with --supported:destructuring=true.

@evanw evanw merged commit 50f78c1 into evanw:main Jun 25, 2023
6 checks passed
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.

None yet

2 participants