Allow boolean literals as class method names#4606
Open
AlbertMarashi wants to merge 5 commits intoboa-dev:mainfrom
Open
Allow boolean literals as class method names#4606AlbertMarashi wants to merge 5 commits intoboa-dev:mainfrom
AlbertMarashi wants to merge 5 commits intoboa-dev:mainfrom
Conversation
The class element parser was missing `TokenKind::BooleanLiteral(_)` in 4 token kind pattern matches, preventing `true` and `false` from being used as class method identifiers. The `PropertyName` parser already handled boolean literals correctly, so only the dispatch patterns in `class_decl/mod.rs` needed updating. Fixes boa-dev#4605 https://claude.ai/code/session_017EhjrAqAAkwhGjQkH7uWZy
Test262 conformance changes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4606 +/- ##
==========================================
+ Coverage 47.24% 56.65% +9.40%
==========================================
Files 476 547 +71
Lines 46892 60065 +13173
==========================================
+ Hits 22154 34029 +11875
- Misses 24738 26036 +1298 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When the VM's `handle_error` encounters a catchable error, and there's an exception handler in the current frame (e.g. the async module evaluation handler), it was storing the error without capturing any backtrace or position info. This meant errors like "not a callable function" TypeErrors created in Rust code had no source location when surfaced through module promise rejection. Two changes: 1. Capture the backtrace at the top of `handle_error`, before checking for exception handlers, so it's always available. 2. Inject the caller position from the shadow stack into native errors that lack one. This position is preserved through the JsError → JS Error object → JsValue → JsError round-trip that occurs during promise rejection, since it's stored on the Error object's internal data. https://claude.ai/code/session_017EhjrAqAAkwhGjQkH7uWZy
…le handler" This reverts commit 9d876a0.
Author
|
Sorry about those other commits... I didn't mean to include them in this PR. They were reverted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request fixes #4605.
It changes the following:
BooleanLiteraltokens (trueandfalse) as valid method names in class definitionsThe parser now correctly handles the ECMAScript specification which allows reserved words like
true,false, andnullto be used as property names in class declarations.