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

属性名に予約語が使用できてしまう #812

Closed
takejohn opened this issue Oct 13, 2024 · 0 comments · Fixed by #863
Closed

属性名に予約語が使用できてしまう #812

takejohn opened this issue Oct 13, 2024 · 0 comments · Fixed by #863

Comments

@takejohn
Copy link
Contributor

属性名に予約語を使用した以下のようなコードが通ってしまうが、

#[class]
let a = 42

このコードを見ると意図としては通らないのが正しそう。

case 'ns':
case 'attr':
case 'identifier':
case 'prop': {
if (reservedWord.includes(node.name)) {
throwReservedWordError(node.name, node.loc);
}
break;
}

原因はvisitNodeDefinitionattrメンバを見ていないことだと考えられる。
case 'def': {
result.expr = visitNode(result.expr, fn) as Ast.Definition['expr'];
break;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant