Commit cfc82ad3 authored by Mathias Bynens's avatar Mathias Bynens Committed by Commit Bot

Remove always-true --harmony-subsume-json flag

The ECMAScript ⊃ JSON proposal shipped in V8 v6.6 and Chrome 66.

Bug: v8:7418
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Id8979d0cec6d61ef4a7e9982142a3f3dcf7c326b
Reviewed-on: https://chromium-review.googlesource.com/1067857Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53271}
parent b09b2369
......@@ -4181,7 +4181,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_class_fields)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_dynamic_import)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_meta)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_optional_catch_binding)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_subsume_json)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_numeric_separator)
#undef EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE
......
......@@ -231,7 +231,6 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields)
// Features that are shipping (turned on by default, but internal flag remains).
#define HARMONY_SHIPPING(V) \
V(harmony_subsume_json, "harmony subsume JSON") \
V(harmony_string_trimming, "harmony String.prototype.trim{Start,End}") \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_regexp_named_captures, "harmony regexp named captures") \
......
......@@ -1073,11 +1073,8 @@ Token::Value Scanner::ScanString() {
AddLiteralChar(c);
}
bool (*line_terminator_func)(unsigned int) =
FLAG_harmony_subsume_json ? unibrow::IsStringLiteralLineTerminator
: unibrow::IsLineTerminator;
while (c0_ != quote && c0_ != kEndOfInput && !line_terminator_func(c0_)) {
while (c0_ != quote && c0_ != kEndOfInput &&
!unibrow::IsStringLiteralLineTerminator(c0_)) {
uc32 c = c0_;
Advance();
if (c == '\\') {
......
......@@ -3731,24 +3731,9 @@ TEST(LineOrParagraphSeparatorAsLineTerminator) {
}
TEST(LineOrParagraphSeparatorInStringLiteral) {
// Tests that both preparsing and parsing treat U+2028 LINE SEPARATOR and
// U+2029 PARAGRAPH SEPARATOR as line terminators within string literals
// when the "subsume JSON" flag is disabled.
v8::internal::FLAG_harmony_subsume_json = false;
const char* context_data[][2] = {
{"\"", "\""}, {"'", "'"}, {nullptr, nullptr}};
const char* statement_data[] = {"\x31\xE2\x80\xA8\x32", // 1<U+2028>2
"\x31\xE2\x80\xA9\x32", // 1<U+2029>2
nullptr};
RunParserSyncTest(context_data, statement_data, kError);
}
TEST(LineOrParagraphSeparatorInStringLiteralHarmony) {
// Tests that both preparsing and parsing don't treat U+2028 LINE SEPARATOR
// and U+2029 PARAGRAPH SEPARATOR as line terminators within string literals
// when the "subsume JSON" flag is enabled.
v8::internal::FLAG_harmony_subsume_json = true;
// and U+2029 PARAGRAPH SEPARATOR as line terminators within string literals.
// https://github.com/tc39/proposal-json-superset
const char* context_data[][2] = {
{"\"", "\""}, {"'", "'"}, {nullptr, nullptr}};
const char* statement_data[] = {"\x31\xE2\x80\xA8\x32", // 1<U+2028>2
......
// Copyright 2018 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: --harmony-subsume-json
// https://tc39.github.io/ecma262/#sec-literals-string-literals
//
// LineContinuation ::
// \ LineTerminatorSequence
//
// LineTerminatorSequence ::
// <LF>
// <CR>[lookahead ≠ <LF>]
// <LS>
// <PS>
// <CR><LF>
// LineTerminatorSequence :: <LF>
assertEquals('', eval('"\\\n"'));
assertEquals('', eval("'\\\n'"));
assertEquals('', eval('`\\\n`'));
// LineTerminatorSequence :: <CR>[lookahead ≠ <LF>]
assertEquals('', eval('"\\\r"'));
assertEquals('', eval("'\\\r'"));
assertEquals('', eval('`\\\r`'));
// LineTerminatorSequence :: <LS>
assertEquals('', eval('"\\\u2028"'));
assertEquals('', eval("'\\\u2028'"));
assertEquals('', eval('`\\\u2028`'));
// LineTerminatorSequence :: <PS>
assertEquals('', eval('"\\\u2029"'));
assertEquals('', eval("'\\\u2029'"));
assertEquals('', eval('`\\\u2029`'));
// LineTerminatorSequence :: <CR><LF>
assertEquals('', eval('"\\\r\n"'));
assertEquals('', eval("'\\\r\n'"));
assertEquals('', eval('`\\\r\n`'));
......@@ -498,6 +498,8 @@
'built-ins/Array/prototype/sort/bug_596_1': [PASS, FAIL_OK],
# https://bugs.chromium.org/p/v8/issues/detail?id=7418
# TODO(mathias): These tests have been removed in upstream Test262.
# Remove them once we sync.
'language/line-terminators/S7.3_A2.3': [FAIL],
'language/line-terminators/S7.3_A2.4': [FAIL],
......
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