Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 833 Bytes

es2018.md

File metadata and controls

44 lines (32 loc) · 833 Bytes

This document specifies the extensions to the core ESTree AST types to support the ES2018 grammar.

Statements

extend interface ForOfStatement {
  await: boolean;
}

for-await-of statements, e.g., for await (const x of xs) {

Expressions

extend interface ObjectExpression {
    properties: [ Property | SpreadElement ];
}

Spread properties, e.g., {a: 1, ...obj, b: 2}.

Template Literals

extend interface TemplateElement {
    value: {
        cooked: string | null;
        raw: string;
    };
}

If the template literal is tagged and the text has an invalid escape, cooked will be null, e.g., tag`\unicode and \u{55}`

Patterns

extend interface ObjectPattern {
    properties: [ AssignmentProperty | RestElement ];
}

Rest properties, e.g., {a, ...rest} = obj.