From a347df3aae41efe71f72aada4d7c9103b24ce12d Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Wed, 24 Oct 2018 16:51:44 -0400 Subject: [PATCH] Add tests for invalid expressions with import() with early ReferenceErrors --- ...ype-reference-error-1-update-expression.js | 46 ++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...ype-reference-error-2-update-expression.js | 46 ++++++++++++++++++ ...ype-reference-error-3-update-expression.js | 46 ++++++++++++++++++ ...ype-reference-error-4-update-expression.js | 46 ++++++++++++++++++ ...rror-5-lhs-equals-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ ...signment-operator-assignment-expression.js | 48 +++++++++++++++++++ 17 files changed, 808 insertions(+) create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-1-update-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-10-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-11-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-12-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-13-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-14-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-15-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-16-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-17-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-2-update-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-3-update-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-4-update-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-5-lhs-equals-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-6-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-7-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-8-lhs-assignment-operator-assignment-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-9-lhs-assignment-operator-assignment-expression.js diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-1-update-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-1-update-expression.js new file mode 100644 index 0000000000..1bd6f94f61 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-1-update-expression.js @@ -0,0 +1,46 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and UpdateExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + UpdateExpressions +esid: prod-ImportCall +info: | + Update Expressions + Static Semantics: Early Errors + + UpdateExpression: + LeftHandSideExpression++ + LeftHandSideExpression-- + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('')++ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-10-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-10-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..3c3c8133c6 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-10-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') -= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-11-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-11-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..f77b454a49 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-11-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') <<= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-12-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-12-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..d89bc729e9 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-12-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') >>= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-13-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-13-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..de6a9e1375 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-13-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') >>>= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-14-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-14-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..9d08c58715 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-14-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') &= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-15-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-15-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..991c602166 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-15-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') ^= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-16-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-16-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..da8fb25596 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-16-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') |= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-17-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-17-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..12c453cfb8 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-17-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') **= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-2-update-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-2-update-expression.js new file mode 100644 index 0000000000..3ab6c49d9f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-2-update-expression.js @@ -0,0 +1,46 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and UpdateExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + UpdateExpressions +esid: prod-ImportCall +info: | + Update Expressions + Static Semantics: Early Errors + + UpdateExpression: + LeftHandSideExpression++ + LeftHandSideExpression-- + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('')-- diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-3-update-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-3-update-expression.js new file mode 100644 index 0000000000..6be301875c --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-3-update-expression.js @@ -0,0 +1,46 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and UnaryExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + UpdateExpressions +esid: prod-ImportCall +info: | + Update Expressions + Static Semantics: Early Errors + + UpdateExpression: + ++UnaryExpression + --UnaryExpression + + - It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +++import('') diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-4-update-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-4-update-expression.js new file mode 100644 index 0000000000..b1f2491bac --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-4-update-expression.js @@ -0,0 +1,46 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and UnaryExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + UpdateExpressions +esid: prod-ImportCall +info: | + Update Expressions + Static Semantics: Early Errors + + UpdateExpression: + ++UnaryExpression + --UnaryExpression + + - It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +--import('') diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-5-lhs-equals-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-5-lhs-equals-assignment-expression.js new file mode 100644 index 0000000000..a70ca47f5d --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-5-lhs-equals-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') = 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-6-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-6-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..74fbb6ec76 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-6-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') *= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-7-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-7-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..1bc28b1989 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-7-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') /= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-8-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-8-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..f236f79cd5 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-8-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') %= 1; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-9-lhs-assignment-operator-assignment-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-9-lhs-assignment-operator-assignment-expression.js new file mode 100644 index 0000000000..a75aafe35e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/invalid-asssignmenttargettype-reference-error-9-lhs-assignment-operator-assignment-expression.js @@ -0,0 +1,48 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + ImportCall is a valid CallExpression and LHSExpression, but it is an invalid + AssginmentTargetType then it should throw a ReferenceError if used in some + LHS Expression of a AssignmentExpression production +esid: prod-ImportCall +info: | + Assignment Operators + Static Semantics: Early Errors + + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Reference Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid. + + AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + + - It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + + LeftHandSideExpression: + NewExpression + CallExpression + + CallExpression: + ImportCall + + Left-Hand-Side Expressions + Static Semantics: AssignmentTargetType + #sec-static-semantics-static-semantics-assignmenttargettype + + CallExpression : + MemberExpressionArguments + SuperCall + ImportCall + CallExpressionArguments + CallExpressionTemplateLiteral + + 1. Return invalid +negative: + phase: parse + type: ReferenceError +features: [dynamic-import] +---*/ + +throw "Test262: This statement should not be evaluated."; + +import('') += 1;