Commit 2c9e38e0 authored by adamk's avatar adamk Committed by Commit bot

Pass legacy const runtime flag to preparser appropriately

It was never being set to false in production (though it was in test-parsing.cc,
due to that test having its own flag-setting logic).

Review URL: https://codereview.chromium.org/1815033002

Cr-Commit-Position: refs/heads/master@{#34878}
parent 434d6601
......@@ -4675,6 +4675,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
reusable_preparser_->set_allow_lazy(true);
#define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name());
SET_ALLOW(natives);
SET_ALLOW(legacy_const);
SET_ALLOW(harmony_sloppy);
SET_ALLOW(harmony_sloppy_let);
SET_ALLOW(harmony_do_expressions);
......
// 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: --no-legacy-const --harmony-sloppy
function f() {
const a;
}
# Copyright 2016 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.
*%(basename)s:8: SyntaxError: Missing initializer in const declaration
const a;
^
SyntaxError: Missing initializer in const declaration
......@@ -157,7 +157,6 @@ PASS access_after_delete_extra_5(1, 2, 3, 4, 5) is 5
PASS argumentsParam(true) is true
PASS argumentsFunctionConstructorParam(true) is true
PASS argumentsVarUndefined() is '[object Arguments]'
FAIL argumentsConstUndefined() should be [object Arguments]. Threw exception SyntaxError: Missing initializer in const declaration
PASS argumentCalleeInException() is argumentCalleeInException
PASS shadowedArgumentsApply([true]) is true
PASS shadowedArgumentsLength([]) is 0
......
......@@ -574,13 +574,6 @@ function argumentsVarUndefined()
}
shouldBe("argumentsVarUndefined()", "'[object Arguments]'");
function argumentsConstUndefined()
{
const arguments;
return String(arguments);
}
shouldBe("argumentsConstUndefined()", "'[object Arguments]'");
function argumentCalleeInException() {
try {
throw "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment