identifier-shorthand-implements-invalid-strict-mode.js (934B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2020 Rick Waldron. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 description: > 7 Object literal shorthands are limited to valid identifier references. Future Reserved Words are disallowed in Strict Mode. (implements) 8 esid: sec-object-initializer 9 flags: [noStrict] 10 info: | 11 PropertyDefinition: 12 IdentifierReference 13 CoverInitializedName 14 PropertyName : AssignmentExpression 15 MethodDefinition 16 17 Identifier : IdentifierName but not ReservedWord 18 It is a Syntax Error if this phrase is contained in strict mode code and 19 the StringValue of IdentifierName is: "implements", "interface", "let", 20 "package", "private", "protected", "public", "static", or "yield". 21 negative: 22 phase: parse 23 type: SyntaxError 24 ---*/ 25 26 $DONOTEVALUATE(); 27 28 var implements = 1; 29 (function() { 30 "use strict"; 31 ({ 32 implements 33 }); 34 });