Skip to content

fix(semantic): disallow let as destructured catch param in sloppy mode#12306

Closed
overlookmotel wants to merge 1 commit into07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_modefrom
07-15-fix_semantic_disallow_let_as_destructured_catch_param_in_sloppy_mode
Closed

fix(semantic): disallow let as destructured catch param in sloppy mode#12306
overlookmotel wants to merge 1 commit into07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_modefrom
07-15-fix_semantic_disallow_let_as_destructured_catch_param_in_sloppy_mode

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 15, 2025

Fix check_binding_identifier to handle oddities around let bindings in catch params.

This is legal:

// Sloppy mode
try {} catch (let) {}

But these are syntax errors!

// Sloppy mode
try {} catch ( { let } ) {}
try {} catch ( [ let ] ) {}

Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 15, 2025

CodSpeed Instrumentation Performance Report

Merging #12306 will not alter performance

Comparing 07-15-fix_semantic_disallow_let_as_destructured_catch_param_in_sloppy_mode (da820b9) with main (3c6b88b)

Summary

✅ 34 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as ready for review July 15, 2025 16:29
@overlookmotel overlookmotel requested a review from Dunqing as a code owner July 15, 2025 16:29
@overlookmotel overlookmotel marked this pull request as draft July 15, 2025 16:30
@overlookmotel overlookmotel changed the base branch from 07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode to graphite-base/12306 July 15, 2025 16:48
@overlookmotel
Copy link
Member Author

I think this is right, but I only based it on observing what NodeJS does. Need to find the part of the spec that covers this and check NodeJS/V8 is right.

@overlookmotel overlookmotel force-pushed the 07-15-fix_semantic_disallow_let_as_destructured_catch_param_in_sloppy_mode branch from 683c0c1 to 9738474 Compare July 15, 2025 17:01
@overlookmotel overlookmotel changed the base branch from graphite-base/12306 to 07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode July 15, 2025 17:01
@overlookmotel overlookmotel force-pushed the 07-15-fix_semantic_disallow_let_as_destructured_catch_param_in_sloppy_mode branch 2 times, most recently from 4c00f41 to c09872e Compare July 16, 2025 17:44
@overlookmotel overlookmotel force-pushed the 07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode branch from ec33e37 to 5710f38 Compare July 16, 2025 17:44
@graphite-app graphite-app bot force-pushed the 07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode branch 2 times, most recently from a3f1d13 to f047374 Compare July 16, 2025 19:01
@graphite-app graphite-app bot force-pushed the 07-15-fix_semantic_disallow_let_as_destructured_catch_param_in_sloppy_mode branch from c09872e to da820b9 Compare July 16, 2025 19:01
@overlookmotel overlookmotel self-assigned this Sep 10, 2025
@Boshen Boshen closed this Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-semantic Area - Semantic C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants