strict_cannot_assign: ["Cannot assign to read only '", "%0", "' in strict mode"],
strict_poison_pill: ["'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them"],
strict_caller: ["Illegal access to a strict mode caller function."],
+ strong_ellision: ["Please don't use arrays with holes in strong mode, use maps instead"],
strong_arguments: ["Please don't use 'arguments' in strong mode, use '...args' instead"],
strong_equal: ["Please don't use '==' or '!=' in strong mode, use '===' or '!==' instead"],
strong_delete: ["Please don't use 'delete' in strong mode, use maps or sets instead"],
while (peek() != Token::RBRACK) {
ExpressionT elem = this->EmptyExpression();
if (peek() == Token::COMMA) {
+ if (is_strong(language_mode())) {
+ ReportMessageAt(scanner()->peek_location(), "strong_ellision");
+ *ok = false;
+ return this->EmptyExpression();
+ }
elem = this->GetLiteralTheHole(peek_position(), factory());
} else {
elem = this->ParseAssignmentExpression(true, CHECK_OK);
--- /dev/null
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --strong-mode
+
+(function NoEllisions() {
+ assertThrows("'use strong'; [,]", SyntaxError);
+ assertThrows("'use strong'; [,3]", SyntaxError);
+ assertThrows("'use strong'; [3,,4]", SyntaxError);
+ assertTrue(eval("'use strong'; [3,] !== [3,4,]"));
+})();