Skip to content

Conversation

@shvaikalesh
Copy link
Member

@shvaikalesh shvaikalesh commented Nov 7, 2023

17d1d74

[JSC] Refine SyntaxError message for generator method parsing failure
https://bugs.webkit.org/show_bug.cgi?id=264368
<rdar://problem/118081884>

Reviewed by Justin Michaud.

This change rewords SyntaxError message, thrown in case of generator method parsing failure,
to mention "method" rather than "function", aligning error wording for sync generator functions
with async counterparts.

Also, tweaks the helper to return "generator function" instead of "generator" for GeneratorBodyMode,
which is unobservable yet matches the terminology of the spec [1].

[1]: https://tc39.es/ecma262/#sec-generator-objects

* JSTests/stress/generator-class-methods-syntax.js:
* JSTests/stress/regress-189292.js:
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::stringForFunctionMode):

Canonical link: https://commits.webkit.org/270379@main

c8b0137

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🧪 gtk-wk2
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ✅ 🧪 jsc-armv7-tests
✅ 🛠 watch ⏳ 🛠 jsc-mips
✅ 🛠 🧪 unsafe-merge ✅ 🛠 watch-sim ⏳ 🧪 jsc-mips-tests

@shvaikalesh shvaikalesh requested a review from a team as a code owner November 7, 2023 23:07
@shvaikalesh shvaikalesh self-assigned this Nov 7, 2023
@shvaikalesh shvaikalesh added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Nov 7, 2023
Copy link
Contributor

@justinmichaud justinmichaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rs=me

@shvaikalesh shvaikalesh force-pushed the eng/JSC-Refine-SyntaxError-message-for-generator-method-parsing-failure branch from e692dd3 to c8b0137 Compare November 8, 2023 01:25
@webkit-early-warning-system
Copy link
Collaborator

Starting EWS tests for c8b0137. Live statuses available at the PR page, #20131

@shvaikalesh shvaikalesh added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 8, 2023
https://bugs.webkit.org/show_bug.cgi?id=264368
<rdar://problem/118081884>

Reviewed by Justin Michaud.

This change rewords SyntaxError message, thrown in case of generator method parsing failure,
to mention "method" rather than "function", aligning error wording for sync generator functions
with async counterparts.

Also, tweaks the helper to return "generator function" instead of "generator" for GeneratorBodyMode,
which is unobservable yet matches the terminology of the spec [1].

[1]: https://tc39.es/ecma262/#sec-generator-objects

* JSTests/stress/generator-class-methods-syntax.js:
* JSTests/stress/regress-189292.js:
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::stringForFunctionMode):

Canonical link: https://commits.webkit.org/270379@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/JSC-Refine-SyntaxError-message-for-generator-method-parsing-failure branch from c8b0137 to 17d1d74 Compare November 8, 2023 09:00
@webkit-commit-queue
Copy link
Collaborator

Committed 270379@main (17d1d74): https://commits.webkit.org/270379@main

Reviewed commits have been landed. Closing PR #20131 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 17d1d74 into WebKit:main Nov 8, 2023
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants