Skip to content

fix(semantic): allow let as arrow function param in sloppy mode#12305

Closed
overlookmotel wants to merge 1 commit intomainfrom
07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode
Closed

fix(semantic): allow let as arrow function param in sloppy mode#12305
overlookmotel wants to merge 1 commit intomainfrom
07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 15, 2025

Previously semantic would produce an error for this in sloppy mode:

const f = (let) => {};

let is legal in this position, but the loop in check_binding_identifier would continue searching past the arrow function, and would hit the VariableDeclarator which produces an error.

Copy link
Member Author

overlookmotel commented Jul 15, 2025

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 #12305 will not alter performance

Comparing 07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode (f047374) with main (b60d63b)

Summary

✅ 34 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as draft July 15, 2025 16:21
@overlookmotel overlookmotel force-pushed the 07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode branch from 12caa0c to ec33e37 Compare 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_allow_let_as_arrow_function_param_in_sloppy_mode branch from ec33e37 to 5710f38 Compare July 16, 2025 17:44
@overlookmotel overlookmotel force-pushed the 07-15-perf_semantic_reduce_match_arms_in_check_binding_identifier_ branch from 9d37edc to f5e99a8 Compare July 16, 2025 17:44
@graphite-app graphite-app bot changed the base branch from 07-15-perf_semantic_reduce_match_arms_in_check_binding_identifier_ to graphite-base/12305 July 16, 2025 18:50
@graphite-app graphite-app bot force-pushed the graphite-base/12305 branch from f5e99a8 to b60d63b Compare July 16, 2025 19:01
@graphite-app graphite-app bot force-pushed the 07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode branch from 5710f38 to a3f1d13 Compare July 16, 2025 19:01
@graphite-app graphite-app bot changed the base branch from graphite-base/12305 to main July 16, 2025 19:01
@graphite-app graphite-app bot force-pushed the 07-15-fix_semantic_allow_let_as_arrow_function_param_in_sloppy_mode branch from a3f1d13 to f047374 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