Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of JS keyword for imported functions, types and statics, and when causing invalid code gen #4329

Merged
merged 19 commits into from
Dec 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Subset
RunDevelopment committed Dec 8, 2024
commit e8bc858998249f423030962083b77eefd2d0b94e
2 changes: 2 additions & 0 deletions crates/macro-support/src/parser.rs
Original file line number Diff line number Diff line change
@@ -77,6 +77,8 @@ const JS_KEYWORDS: [&str; 47] = [

/// Javascript keywords that behave like values in that they can be called like
/// functions or have properties accessed on them.
///
/// Naturally, this list is a subset of `JS_KEYWORDS`.
const VALUE_LIKE_JS_KEYWORDS: [&str; 7] = [
"eval", // eval is a function-like keyword, so e.g. `eval(...)` is valid
"false", // false resolves to a boolean value, so e.g. `false.toString()` is valid