Skip to content

fix(parser): correct the method's FormalParameterKind to UniqueFormalParameters#10162

Merged
graphite-app[bot] merged 1 commit intomainfrom
04-01-fix_parser_correct_the_method_value_
Apr 1, 2025
Merged

fix(parser): correct the method's FormalParameterKind to UniqueFormalParameters#10162
graphite-app[bot] merged 1 commit intomainfrom
04-01-fix_parser_correct_the_method_value_

Conversation

@Dunqing
Copy link
Copy Markdown
Member

@Dunqing Dunqing commented Apr 1, 2025

https://tc39.es/ecma262/#sec-method-definitions-static-semantics-early-errors

15.4.1 Static Semantics: Early Errors
MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody }
It is a Syntax Error if FunctionBodyContainsUseStrict of FunctionBody is true and IsSimpleParameterList of UniqueFormalParameters is false.
It is a Syntax Error if any element of the BoundNames of UniqueFormalParameters also occurs in the LexicallyDeclaredNames of FunctionBody.

As you can see, the parameters of the method definition should be UniqueFormalParameters.

Copy link
Copy Markdown
Member Author

Dunqing commented Apr 1, 2025


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.

@Dunqing Dunqing requested a review from Boshen April 1, 2025 09:03
@github-actions github-actions bot added A-parser Area - Parser C-bug Category - Bug labels Apr 1, 2025
@Dunqing
Copy link
Copy Markdown
Member Author

Dunqing commented Apr 1, 2025

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 1, 2025

CodSpeed Instrumentation Performance Report

Merging #10162 will create unknown performance changes

Comparing 04-01-fix_parser_correct_the_method_value_ (41a985e) with main (bc54d1f)

Summary

🆕 36 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[checker.ts] N/A 22.6 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 65.6 ms N/A
🆕 formatter[antd.js] N/A 7.6 ms N/A
🆕 formatter[react.development.js] N/A 43.8 µs N/A
🆕 formatter[typescript.js] N/A 7.4 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 58.2 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 21.1 µs N/A
🆕 lexer[antd.js] N/A 24.8 ms N/A
🆕 lexer[cal.com.tsx] N/A 5.9 ms N/A
🆕 lexer[checker.ts] N/A 14.8 ms N/A
🆕 lexer[pdf.mjs] N/A 3.9 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.7 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 2.9 s N/A
🆕 mangler[antd.js] N/A 16 ms N/A
🆕 mangler[react.development.js] N/A 293.8 µs N/A
🆕 mangler[typescript.js] N/A 39.7 ms N/A
🆕 minifier[antd.js] N/A 165.6 ms N/A
🆕 minifier[react.development.js] N/A 1.8 ms N/A
🆕 minifier[typescript.js] N/A 291.6 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@Dunqing Dunqing force-pushed the 04-01-fix_parser_correct_the_method_value_ branch from c88513a to ffa12ec Compare April 1, 2025 09:32
@Dunqing Dunqing force-pushed the 04-01-fix_semantic_reserved_words_cannot_be_used_as_class_binding_in_script_code branch from da0e352 to 799fea9 Compare April 1, 2025 09:32
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Apr 1, 2025
Copy link
Copy Markdown
Member

Boshen commented Apr 1, 2025

Merge activity

…eFormalParameters` (#10162)

https://tc39.es/ecma262/#sec-method-definitions-static-semantics-early-errors

15.4.1 Static Semantics: Early Errors
[MethodDefinition](https://tc39.es/ecma262/#prod-MethodDefinition) : [ClassElementName](https://tc39.es/ecma262/#prod-ClassElementName) ( [UniqueFormalParameters](https://tc39.es/ecma262/#prod-UniqueFormalParameters) ) { [FunctionBody](https://tc39.es/ecma262/#prod-FunctionBody) }
It is a Syntax Error if [FunctionBodyContainsUseStrict](https://tc39.es/ecma262/#sec-static-semantics-functionbodycontainsusestrict) of [FunctionBody](https://tc39.es/ecma262/#prod-FunctionBody) is true and [IsSimpleParameterList](https://tc39.es/ecma262/#sec-static-semantics-issimpleparameterlist) of [UniqueFormalParameters](https://tc39.es/ecma262/#prod-UniqueFormalParameters) is false.
It is a Syntax Error if any element of the [BoundNames](https://tc39.es/ecma262/#sec-static-semantics-boundnames) of [UniqueFormalParameters](https://tc39.es/ecma262/#prod-UniqueFormalParameters) also occurs in the [LexicallyDeclaredNames](https://tc39.es/ecma262/#sec-static-semantics-lexicallydeclarednames) of [FunctionBody](https://tc39.es/ecma262/#prod-FunctionBody).

As you can see, the parameters of the method definition should be `UniqueFormalParameters`.
@graphite-app graphite-app bot force-pushed the 04-01-fix_semantic_reserved_words_cannot_be_used_as_class_binding_in_script_code branch from 799fea9 to 10cc886 Compare April 1, 2025 13:06
@graphite-app graphite-app bot force-pushed the 04-01-fix_parser_correct_the_method_value_ branch from ffa12ec to 41a985e Compare April 1, 2025 13:06
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 1, 2025
Base automatically changed from 04-01-fix_semantic_reserved_words_cannot_be_used_as_class_binding_in_script_code to main April 1, 2025 13:14
@graphite-app graphite-app bot merged commit 41a985e into main Apr 1, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 04-01-fix_parser_correct_the_method_value_ branch April 1, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants