diff --git a/attribute-order.conf b/attribute-order.conf index 44dd18d..e1eab14 100644 --- a/attribute-order.conf +++ b/attribute-order.conf @@ -138,6 +138,7 @@ test declaration [ExportAllFrom] +name moduleSpecifier [ExportDeclaration] @@ -234,6 +235,9 @@ moduleSpecifier [ImportDeclaration] moduleSpecifier +[ImportExpression] +source + [ImportNamespace] defaultBinding namespaceBinding @@ -250,6 +254,10 @@ body label body +[LiteralBigIntExpression] +bigint +value + [LiteralBooleanExpression] value @@ -300,7 +308,9 @@ name callee arguments -[NewTargetExpression] +[MetaProperty] +meta +property [Node] @@ -317,6 +327,13 @@ properties [ObjectProperty] +[OptionalChainingExpression] +expression + +[OptionalMemberExpression] +object +property + [Program] [PropertyName] diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..95094f5 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,48 @@ +{ + "name": "shift-spec-idl", + "version": "2020.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "shift-spec-idl", + "version": "2020.0.0", + "license": "Apache-2.0", + "devDependencies": { + "shift-spec-consumer": "^1.0.0" + } + }, + "node_modules/shift-spec-consumer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/shift-spec-consumer/-/shift-spec-consumer-1.0.1.tgz", + "integrity": "sha1-9nZS3vwYgGeAqOBLT58IoP/iOpw=", + "dev": true, + "dependencies": { + "webidl2": "^2.0.11" + } + }, + "node_modules/webidl2": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/webidl2/-/webidl2-2.4.0.tgz", + "integrity": "sha1-Wm8oK3K0ec6grsIisUuDM325cpA=", + "dev": true + } + }, + "dependencies": { + "shift-spec-consumer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/shift-spec-consumer/-/shift-spec-consumer-1.0.1.tgz", + "integrity": "sha1-9nZS3vwYgGeAqOBLT58IoP/iOpw=", + "dev": true, + "requires": { + "webidl2": "^2.0.11" + } + }, + "webidl2": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/webidl2/-/webidl2-2.4.0.tgz", + "integrity": "sha1-Wm8oK3K0ec6grsIisUuDM325cpA=", + "dev": true + } + } +} diff --git a/package.json b/package.json index 74ae6b8..f477748 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shift-spec-idl", - "version": "2019.0.0", + "version": "2020.0.0", "description": "Shift AST specification IDL files", "author": "Shape Security", "homepage": "https://github.com/shapesecurity/shift-spec", diff --git a/spec.idl b/spec.idl index b44524f..8b0f264 100644 --- a/spec.idl +++ b/spec.idl @@ -47,7 +47,7 @@ enum CompoundAssignmentOperator { }; enum BinaryOperator { "==", "!=", "===", "!==", "<", "<=", ">", ">=", "in", "instanceof", "<<", - ">>", ">>>", "+", "-", "*", "/", "%", "**", ",", "||", "&&", "|", "^", "&" + ">>", ">>>", "+", "-", "*", "/", "%", "**", ",", "||", "&&", "|", "^", "&", "??" }; enum UnaryOperator { "+", "-", "!", "~", "typeof", "void", "delete" }; enum UpdateOperator { "++", "--" }; @@ -255,8 +255,9 @@ interface ImportSpecifier : Node { attribute BindingIdentifier binding; }; -// `export * FromClause;` +// `export * FromClause;`, `export * as IdentifierName FromClause` interface ExportAllFrom : ExportDeclaration { + attribute IdentifierName? name; attribute string moduleSpecifier; }; @@ -349,6 +350,12 @@ interface StaticPropertyName : PropertyName { // literals +// `BigIntLiteral` +interface LiteralBigIntExpression : Expression { + attribute string bigint; + attribute double value; +}; + // `BooleanLiteral` interface LiteralBooleanExpression : Expression { attribute boolean value; @@ -412,7 +419,7 @@ interface AssignmentExpression : Expression { attribute Expression expression; }; -// `ExponentiationExpression`, `MultiplicativeExpression`, `AdditiveExpression`, `ShiftExpression`, `RelationalExpression`, `EqualityExpression`, `BitwiseANDExpression`, `BitwiseXORExpression`, `BitwiseORExpression`, `LogicalANDExpression`, `LogicalORExpression` +// `ExponentiationExpression`, `MultiplicativeExpression`, `AdditiveExpression`, `ShiftExpression`, `RelationalExpression`, `EqualityExpression`, `BitwiseANDExpression`, `BitwiseXORExpression`, `BitwiseORExpression`, `LogicalANDExpression`, `LogicalORExpression`, `NullishCoalescingExpression` interface BinaryExpression : Expression { attribute BinaryOperator operator; // The expression before the operator. @@ -459,17 +466,34 @@ FunctionExpression implements Function; interface IdentifierExpression : Expression { }; IdentifierExpression implements VariableReference; +// `ImportExpression` +interface ImportExpression : Expression { + attribute Expression source; +}; + +// `import.meta`, `new.target` +interface MetaProperty: Expression { + attribute Identifier meta; + attribute Identifier property; +}; + interface NewExpression : Expression { attribute Expression callee; attribute Arguments arguments; }; -interface NewTargetExpression : Expression { }; - interface ObjectExpression : Expression { attribute ObjectProperty[] properties; }; +interface OptionalChainingExpression: Expression { + attribute Expression expression; +}; + +interface OptionalMemberExpression: MemberExpression { + attribute IdentifierName property; +}; + interface UnaryExpression : Expression { attribute UnaryOperator operator; attribute Expression operand;