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

Missing syntax restrictions #71

Open
3 of 9 tasks
achudnov opened this issue Dec 11, 2015 · 1 comment
Open
3 of 9 tasks

Missing syntax restrictions #71

achudnov opened this issue Dec 11, 2015 · 1 comment
Assignees

Comments

@achudnov
Copy link
Member

Quoting the spec, chapter 16. We support those marked with [x].

An implementation must treat any instance of the following kinds of errors as an early error:

  • Any syntax error.
  • Attempts to define an ObjectLiteral that has multiple get property assignments with the same name or multiple set property assignments with the same name.
  • Attempts to define an ObjectLiteral that has both a data property assignment and a get or set property assignment with the same name.
  • Errors in regular expression literals that are not implementation-defined syntax extensions.
  • Attempts in strict mode code to define an ObjectLiteral that has multiple data property assignments with the same name.
  • The occurrence of a WithStatement in strict mode code.
  • The occurrence of an Identifier value appearing more than once within a FormalParameterList of an individual strict mode FunctionDeclaration or FunctionExpression.
  • Improper uses of return, break, and continue.
  • Attempts to call PutValue on any value for which an early determination can be made that the value is not a Reference (for example, executing the assignment statement 3=4).
@achudnov achudnov self-assigned this Dec 11, 2015
@achudnov achudnov added this to the ECMAScript 5 support milestone Dec 11, 2015
@achudnov
Copy link
Member Author

I'm thinking that syntax restrictions ---pretty much any of the above except for an outright syntax error--- should be spun off into isValid in Syntax, since we would need to perform the same checks there too. However, the function would need to be extended to report the error position and kind. The former would be based on the position annotations in the AST.

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

No branches or pull requests

1 participant