Skip to content

Instantly share code, notes, and snippets.

@michaelficarra
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelficarra/a15104b743565aed94e4 to your computer and use it in GitHub Desktop.
Save michaelficarra/a15104b743565aed94e4 to your computer and use it in GitHub Desktop.
  • ArrayBinding

    • restElement must be BindingIdentifier or null except when ArrayBinding is part of an AssignmentPattern
  • BindingIdentifier

    • name must match the ES6 IdentifierName lexical grammar except when name is "*default*" and BindingIdentifier is the name of a ClassDeclaration or FunctionDeclaration which is the body of an ExportDefault
    • name must not be a reserved word
    • name must not be a future reserved word in strict mode
    • (12.1.1 and 12.14.5.1 and 14.1.2 and 14.4.1) name must not be a restricted word in strict mode
    • (12.1.1) name must not be yield in strict mode
  • ImportSpecifier

    • name must match the ES6 IdentifierName lexical grammar
  • ExportSpecifier

    • (15.2.3.1?) name must not be a reserved word or future reserved word except when ExportSpecifier is the namedExports of an ExportFrom
  • Method

    • (14.3.1 and 14.4.1) body must not contain (without crossing a lexical boundary) a FunctionDeclaration, ClassDeclaration, or VariableDeclaration with kind of let or const whose bound names intersect the bound names of params
  • Setter

    • param must not contain a MemberExpression
    • (14.3.1) param must not have duplicate bindings
    • (14.3.1) body must not contain (without crossing a lexical boundary) a FunctionDeclaration, ClassDeclaration, or VariableDeclaration with kind of let or const whose bound names intersect the bound names of params
  • ShorthandProperty

    • name must match the ES6 IdentifierName lexical grammar
    • name must not be a reserved word
    • (12.1.1) name must not be a future reserved word in strict mode
    • (12.1.1) name must not be yield in strict mode
  • ArrowExpression

    • (14.2.1) body must not contain (without crossing a lexical boundary) a FunctionDeclaration, ClassDeclaration, or VariableDeclaration with kind of let or const whose bound names intersect the bound names of params
  • AssignmentExpression

    • (12.14.1) binding must be a BindingIdentifier or MemberExpression when operator is not "="
  • FunctionExpression

    • (14.1.2) body must not contain (without crossing a lexical boundary) a FunctionDeclaration, ClassDeclaration, or VariableDeclaration with kind of let or const whose bound names intersect the bound names of params
  • IdentifierExpression

    • name must match the ES6 IdentifierName lexical grammar
    • name must not be a reserved word
    • (12.1.1) name must not be a future reserved word in strict mode
    • (12.1.1) name must not be yield in strict mode
  • LiteralNumericExpression

    • value must be finite
    • value must not be a NaN value
    • value must be non-negative
  • LiteralRegExpExpression

    • (12.2.7.1) pattern must match the ES6 Pattern lexical grammar
    • (12.2.7.1) flags must not contain any characters other than "g", "i", "m", "u", or "y"
    • (12.2.7.1) flags must not contain more than one instance of any single character
  • ObjectExpression

    • (12.2.5.1 and B.3.1) ObjectExpression must not have more than data property with name __proto__
    • (12.2.5.1) properties must not contain a BindingWithDefault
  • PostfixExpression

    • (12.4.1) operand must be a BindingIdentifier or MemberExpression if operator is ++ or --
  • PrefixExpression

    • (12.5.1) operand must be a BindingIdentifier or MemberExpression if operator is ++ or --
    • (12.5.4.1) operand must not be an IdentifierExpression if operator is delete in strict mode
  • StaticMemberExpression

    • property must match the ES6 IdentifierName lexical grammar
  • TemplateExpression

    • elements must be non-empty
    • elements must alternate between TemplateElement and Expression
    • the first and last elements of elements must be TemplateElements
  • BreakStatement

    • label must match the ES6 IdentifierName lexical grammar when label is non-null
    • label must not be a reserved word
    • (12.1.1) label must not be a future reserved word in strict mode
    • (12.1.1) label must not be yield in strict mode
    • (14.1.2 and 15.1.1 and 15.2.1.1) BreakStatement with label must be within a correspondingly labeled statement (without crossing a function boundary)
    • (13.8.1) BreakStatement without label must be within an IterationStatement or a SwitchStatement
  • ContinueStatement

    • label must match the ES6 IdentifierName lexical grammar when label is non-null
    • label must not be a reserved word
    • (12.1.1) label must not be a future reserved word in strict mode
    • (12.1.1) label must not be yield in strict mode
    • (13.7.1 and 14.1.2 and 15.1.1 and 15.2.1.1) ContinueStatement with label must be within a labeled iteration statement (without crossing a function boundary)
    • (13.7.1) ContinueStatement without label must be within an iteration statement
  • DoWhileStatement

    • (13.6.0.1) body must not be a LabeledStatement whose body is a FunctionDeclaration
  • ForInStatement

    • left must not be a VariableDeclaration with more than one VariableDeclarator in its declarators
    • (13.6.4.1) body must not contain (without crossing a function boundary) a VariableDeclaration with kind of var whose bound names intersect the bound names of left if left is a VariableDeclaration with kind of let or const
    • (13.6.0.1) body must not be a LabeledStatement whose body is a FunctionDeclaration
  • ForOfStatement

    • left must not be a VariableDeclaration with more than one VariableDeclarator in its declarators
    • (13.6.4.1) body must not contain (without crossing a function boundary) a VariableDeclaration with kind of var whose bound names intersect the bound names of left if left is a VariableDeclaration with kind of let or const
    • (13.6.0.1) body must not be a LabeledStatement whose body is a FunctionDeclaration
  • ForStatement

    • (13.6.3.1) body must not contain (without crossing a function boundary) a VariableDeclaration with kind of var whose bound names intersect the bound names of init if init is a VariableDeclaration with kind of let or const
    • (13.6.0.1) body must not be a LabeledStatement whose body is a FunctionDeclaration
  • IfStatement

    • consequent must not have a trailing else when alternate is null
    • (13.5.1) consequent and alternate must not be a LabeledStatement whose body is a FunctionDeclaration
  • LabeledStatement

    • (13.12.1) body must not be a FunctionDeclaration in strict mode
    • body must not be a FunctionDeclaration if isGenerator of FunctionDeclaration is true
    • label must match the ES6 IdentifierName lexical grammar
    • label must not be a reserved word
    • (12.1.1) label must not be a future reserved word in strict mode
    • (12.1.1) label must not be yield in strict mode
    • (14.1.2 and 15.1.1 and 15.2.1.1) LabeledStatement must not contain (without crossing a function boundary) a LabeledStatement with the same label
  • ReturnStatement

    • ReturnStatement must be nested within a FunctionExpression, FunctionDeclaration, Getter, Setter, Method, or ArrowExpression node
  • SwitchStatement

    • (13.11.1) cases must not contain (without crossing a lexical boundary) a VariableDeclaration with kind of let or const whose bound names intersect the bound names of another VariableDeclaration with kind of let or const contained (without crossing a lexical boundary) in cases
    • (13.11.1) cases must not contain (without crossing a lexical boundary) a VariableDeclaration with kind of let or const whose bound names intersect the bound names of a VariableDeclaration with kind of var contained (without crossing a function boundary) in cases
  • SwitchStatementWithDefault

  • WhileStatement

    • (13.6.0.1) body must not be a LabeledStatement whose body is a FunctionDeclaration
  • WithStatement

    • (13.10.1) WithStatement must not exist in strict mode
    • (13.10.1) body must not be a LabeledStatement whose body is a FunctionDeclaration
  • CatchClause

    • (13.14.1) binding must not have any duplicate bound names
    • binding must not contain a MemberExpression
    • (13.14.1 and B.3.5) body must not contain (without crossing a lexical boundary) a ClassDeclaration, FunctionDeclaration, or VariableDeclaration with kind of let or const with bound names that intersect the bound names of binding
    • (13.14.1 and B.3.5) body must not contain (without crossing a function boundary) a VariableDeclaration with kind of var whose bound names intersect the bound names of binding if VariableDeclaration is the init of ForStatement, the declaration of VariableDeclarationStatement, or the left of ForInStatement
  • Directive

    • rawValue must be the empty string or match either of the ES6 lexical grammars DoubleStringCharacters or SingleStringCharacters
  • FormalParameters

    • items must not contain a MemberExpression
    • (14.1.2 and 14.4.1) FormalParameters must not have duplicate bound names in strict mode
    • (14.1.2) FormalParameters must not have duplicate bound names if FormalParameters is the params of a Method or an ArrowExpression
    • (14.1.2) FormalParamaters must not have duplicate bound names if rest is non-null or if items contains an ObjectBinding, ArrayBinding, or BindingWithDefault
  • FunctionDeclaration

    • (14.1.2) body must not contain (without crossing a function boundary) a FunctionDeclaration, ClassDeclaration, or VariableDeclaration with kind of let or const whose bound names intersect the bound names of params
  • Module

    • (15.2.1.1) Module must not contain any duplicate exported names
    • (15.2.1.1) the exported names of Module must each appear in the bound names of a VariableDeclaration with a kind of var in items (without crossing a function boundary) or the bound names of a VariableDeclaration with a kind of let or const in items (without crossing a function boundary)
    • (15.2.2.1) Module must not contain any duplicate imported names
    • (15.2.1.1) items must not contain (without crossing a function boundary) NewTargetExpression
    • (11.6.2.2) items must not contain an IdentifierExpression or ShorhandProperty whose name is "await".
  • Script

    • (15.1.1) body must not contain (without crossing a function boundary) NewTargetExpression
  • Super

    • TODO: move these to CallExpression and MemberExpression (or maybe FunctionBody and Module)
    • (12.2.5.1 and 14.1.2 and 14.4.1 and 14.5.1 and 15.1.1 and 15.2.1.1) Super must be nested (without crossing function boundaries) within a Method with isGenerator of false and a StaticPropertyName name whose value is "constructor" in a ClassExpression or ClassDeclaration with non-null super if it is the callee of a CallExpression
    • (12.2.5.1 and 14.1.2 and 14.4.1 and 14.5.1 and 15.1.1 and 15.2.1.1) Super must be nested (without crossing function boundaries) within a Method with isGenerator of false in a ClassExpression or ClassDeclaration with non-null super if it is the object of a MemberExpression
  • TemplateElement

    • rawValue must match the ES6 TemplateCharacters lexical grammar
  • VariableDeclaration

    • declarators must be non-empty

    • (13.2.1.1 and 13.6.4.1) VariableDeclaration must not have duplicate bound names if kind is let or const

    • (13.2.1.1 and 13.6.4.1) VariableDeclaration must not have let in its bound names if kind is let or const

    • (13.1.1 and 15.1.1 and 15.2.1.1) VariableDeclaration must not be contained within a Block, FunctionBody, or Module (without crossing Block or FunctionBody boundaries) with any other VariableDeclaration with kind let or const and bound names that intersect the bound names of VariableDeclaration if kind is let or const

    • (14.1.2 and 15.1.1 and 15.2.1.1) VariableDeclaration must not be contained within a FunctionBody or Module (without crossing FunctionBody boundaries) with any other VariableDeclaration with kind var and bound names that intersect the bound names of VariableDeclaration if kind is let or const

  • VariableDeclarator

    • (13.2.1.1) init must not be null when VariableDeclarator is in the declarators list of a VariableDeclaration whose kind is const
    • init must not be null except when VariableDeclarator is in the declarators list of a VariableDeclaration that is the declaration of an Export
    • init must be null when VariableDeclarator is in the declarators list of a VariableDeclaration that is the left of a ForInStatement or ForOfStatement
    • binding must not contain a MemberExpression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment