summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/object/identifier-shorthand-package-invalid-strict-mode.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/expressions/object/identifier-shorthand-package-invalid-strict-mode.js')
-rw-r--r--js/src/tests/test262/language/expressions/object/identifier-shorthand-package-invalid-strict-mode.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/object/identifier-shorthand-package-invalid-strict-mode.js b/js/src/tests/test262/language/expressions/object/identifier-shorthand-package-invalid-strict-mode.js
new file mode 100644
index 0000000000..74f37c120f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/object/identifier-shorthand-package-invalid-strict-mode.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: >
+ Object literal shorthands are limited to valid identifier references. Future Reserved Words are disallowed in Strict Mode. (package)
+esid: sec-object-initializer
+flags: [noStrict]
+info: |
+ PropertyDefinition:
+ IdentifierReference
+ CoverInitializedName
+ PropertyName : AssignmentExpression
+ MethodDefinition
+
+ Identifier : IdentifierName but not ReservedWord
+ It is a Syntax Error if this phrase is contained in strict mode code and
+ the StringValue of IdentifierName is: "implements", "interface", "let",
+ "package", "private", "protected", "public", "static", or "yield".
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var package = 1;
+(function() {
+ "use strict";
+ ({
+ package
+ });
+});