Reviewers: rossberg,
Description:
Delete --harmony-unicode flag
It was shipped in V8 4.4.
Please review this at https://codereview.chromium.org/1271073002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+6, -77 lines):
M src/bootstrapper.cc
M src/flag-definitions.h
M src/parser.cc
M src/preparser.h
M src/scanner.h
M src/scanner.cc
M test/cctest/test-parsing.cc
M test/mjsunit/es6/templates.js
A + test/mjsunit/es6/unicode-escapes.js
D test/mjsunit/harmony/unicode-escapes.js
Index: test/mjsunit/harmony/unicode-escapes.js
diff --git a/test/mjsunit/harmony/unicode-escapes.js
b/test/mjsunit/harmony/unicode-escapes.js
deleted file mode 100644
index
b39ee1a5b05f96c1c86f05a86da2b5c52691ec2d..0000000000000000000000000000000000000000
--- a/test/mjsunit/harmony/unicode-escapes.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2014 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.
-
-// ES6 extends the \uxxxx escape and also allows \u{xxxxx}.
-
-// Flags: --harmony-unicode
-
-// Unicode escapes in variable names.
-
-(function TestVariableNames1() {
- var foobar = 1;
- assertEquals(foob\u0061r, 1);
- assertEquals(foob\u{0061}r, 1);
- assertEquals(foob\u{61}r, 1);
- assertEquals(foob\u{0000000061}r, 1);
-})();
-
-(function TestVariableNames2() {
- var foobar = 1;
- assertEquals(\u0066oobar, 1);
- assertEquals(\u{0066}oobar, 1);
- assertEquals(\u{66}oobar, 1);
- assertEquals(\u{0000000066}oobar, 1);
-})();
-
-// Unicode escapes in strings.
-
-(function TestStrings() {
- var s1 = "foob\u0061r";
- assertEquals(s1, "foobar");
- var s2 = "foob\u{0061}r";
- assertEquals(s2, "foobar");
- var s3 = "foob\u{61}r";
- assertEquals(s3, "foobar");
- var s4 = "foob\u{0000000061}r";
- assertEquals(s4, "foobar");
-})();
-
-
-(function TestSurrogates() {
- // U+10E6D corresponds to the surrogate pair [U+D803, U+DE6D].
- var s1 = "foo\u{10e6d}";
- var s2 = "foo\u{d803}\u{de6d}";
- assertEquals(s1, s2);
-})();
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index
c46cc2e525455951a6f7f0613e0e3153eb113b33..843e0bb1e5bd5088cafc5fdb9d9f439e85be80b1
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1843,7 +1843,6 @@
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_arrow_functions)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_tostring)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sloppy)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sloppy_let)
-EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode_regexps)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters)
@@ -1881,7 +1880,6 @@
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy_let)
-EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spreadcalls)
@@ -2564,7 +2562,6 @@ bool Genesis::InstallExperimentalNatives() {
nullptr};
static const char* harmony_sloppy_natives[] = {nullptr};
static const char* harmony_sloppy_let_natives[] = {nullptr};
- static const char* harmony_unicode_natives[] = {nullptr};
static const char* harmony_unicode_regexps_natives[] = {nullptr};
static const char* harmony_computed_property_names_natives[] = {nullptr};
static const char* harmony_rest_parameters_natives[] = {nullptr};
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index
60bbdc72b055bb00ddeef64263369faa88f47f93..19fecb722c6b68717a67f695cfd0c7494d2133f4
100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -213,7 +213,6 @@ DEFINE_BOOL(legacy_const, true, "legacy semantics for
const in sloppy mode")
V(harmony_object_observe, "harmony Object.observe") \
V(harmony_spreadcalls, "harmony spread-calls") \
V(harmony_spread_arrays, "harmony spread in array literals") \
- V(harmony_unicode, "harmony unicode escapes") \
V(harmony_object, "harmony Object methods")
// Once a shipping feature has proved stable in the wild, it will be
dropped
@@ -241,7 +240,6 @@ HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES)
// Feature dependencies.
-DEFINE_IMPLICATION(harmony_unicode_regexps, harmony_unicode)
DEFINE_IMPLICATION(harmony_sloppy_let, harmony_sloppy)
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index
311d192f8e694777f48b339bd723369516a4b816..449d01cd66eeb05330a961f0d36afccc87817c97
100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -914,7 +914,6 @@ Parser::Parser(ParseInfo* info)
set_allow_harmony_arrow_functions(FLAG_harmony_arrow_functions);
set_allow_harmony_sloppy(FLAG_harmony_sloppy);
set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let);
- set_allow_harmony_unicode(FLAG_harmony_unicode);
set_allow_harmony_computed_property_names(
FLAG_harmony_computed_property_names);
set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters);
@@ -4479,7 +4478,6 @@ PreParser::PreParseResult
Parser::ParseLazyFunctionBodyWithPreParser(
SET_ALLOW(harmony_arrow_functions);
SET_ALLOW(harmony_sloppy);
SET_ALLOW(harmony_sloppy_let);
- SET_ALLOW(harmony_unicode);
SET_ALLOW(harmony_computed_property_names);
SET_ALLOW(harmony_rest_parameters);
SET_ALLOW(harmony_spreadcalls);
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index
3bd0953cb627122adaf0691918545a8034469ecb..3cdbc5988a68c5d0a380028c7613c8d4f803cfe2
100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -131,10 +131,8 @@ class ParserBase : public Traits {
#undef ALLOW_ACCESSORS
bool allow_harmony_modules() const { return scanner()->HarmonyModules();
}
- bool allow_harmony_unicode() const { return scanner()->HarmonyUnicode();
}
void set_allow_harmony_modules(bool a) {
scanner()->SetHarmonyModules(a); }
- void set_allow_harmony_unicode(bool a) {
scanner()->SetHarmonyUnicode(a); }
protected:
enum AllowRestrictedIdentifiers {
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index
ad7c7d983c5e375afa7ddea2b1e89d6ac2ea89fd..ca9053c139b43c5d56edeeabbb3a29c3b37d410c
100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -41,8 +41,7 @@ Scanner::Scanner(UnicodeCache* unicode_cache)
: unicode_cache_(unicode_cache),
bookmark_c0_(kNoBookmark),
octal_pos_(Location::invalid()),
- harmony_modules_(false),
- harmony_unicode_(false) {
+ harmony_modules_(false) {
bookmark_current_.literal_chars = &bookmark_current_literal_;
bookmark_current_.raw_literal_chars = &bookmark_current_raw_literal_;
bookmark_next_.literal_chars = &bookmark_next_literal_;
@@ -1076,10 +1075,10 @@ uc32 Scanner::ScanIdentifierUnicodeEscape() {
template <bool capture_raw>
uc32 Scanner::ScanUnicodeEscape() {
- // Accept both \uxxxx and \u{xxxxxx} (if harmony unicode escapes are
- // allowed). In the latter case, the number of hex digits between { } is
+ // Accept both \uxxxx and \u{xxxxxx}.
+ // In the latter case, the number of hex digits between { } is
// arbitrary. \ and u have already been read.
- if (c0_ == '{' && HarmonyUnicode()) {
+ if (c0_ == '{') {
Advance<capture_raw>();
uc32 cp = ScanUnlimitedLengthHexNumber<capture_raw>(0x10ffff);
if (cp < 0) {
Index: src/scanner.h
diff --git a/src/scanner.h b/src/scanner.h
index
c842f987b62718b9651e56d7cd900471e788e594..550e069c0ed5d1ba3b8bcc2187b6b31166fd21fb
100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -485,9 +485,6 @@ class Scanner {
harmony_modules_ = modules;
}
- bool HarmonyUnicode() const { return harmony_unicode_; }
- void SetHarmonyUnicode(bool unicode) { harmony_unicode_ = unicode; }
-
// Returns true if there was a line terminator before the peek'ed token,
// possibly inside a multi-line comment.
bool HasAnyLineTerminatorBeforeNext() const {
@@ -799,8 +796,6 @@ class Scanner {
bool has_multiline_comment_before_next_;
// Whether we scan 'module', 'import', 'export' as keywords.
bool harmony_modules_;
- // Whether we allow \u{xxxxx}.
- bool harmony_unicode_;
};
} } // namespace v8::internal
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index
66f7f75efaf6ff9886b5dbd22ce9e89a8d4366bc..01dbd9096e184fabaf522c87a0ffef6de9d59d4a
100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -1432,7 +1432,6 @@ enum ParserFlag {
kAllowHarmonyRestParameters,
kAllowHarmonySloppy,
kAllowHarmonySloppyLet,
- kAllowHarmonyUnicode,
kAllowHarmonyComputedPropertyNames,
kAllowHarmonySpreadCalls,
kAllowHarmonyDestructuring,
@@ -1463,7 +1462,6 @@ void SetParserFlags(i::ParserBase<Traits>* parser,
flags.Contains(kAllowHarmonySpreadCalls));
parser->set_allow_harmony_sloppy(flags.Contains(kAllowHarmonySloppy));
parser->set_allow_harmony_sloppy_let(flags.Contains(kAllowHarmonySloppyLet));
- parser->set_allow_harmony_unicode(flags.Contains(kAllowHarmonyUnicode));
parser->set_allow_harmony_computed_property_names(
flags.Contains(kAllowHarmonyComputedPropertyNames));
parser->set_allow_harmony_destructuring(
@@ -4865,9 +4863,7 @@ TEST(InvalidUnicodeEscapes) {
"var foob\\v{1234}r = 0;",
"var foob\\U{1234}r = 0;",
NULL};
- static const ParserFlag always_flags[] = {kAllowHarmonyUnicode};
- RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
- arraysize(always_flags));
+ RunParserSyncTest(context_data, data, kError);
}
@@ -4893,9 +4889,7 @@ TEST(UnicodeEscapes) {
// Max value for the unicode escape
"\"\\u{10ffff}\"",
NULL};
- static const ParserFlag always_flags[] = {kAllowHarmonyUnicode};
- RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags,
- arraysize(always_flags));
+ RunParserSyncTest(context_data, data, kSuccess);
}
Index: test/mjsunit/es6/templates.js
diff --git a/test/mjsunit/es6/templates.js b/test/mjsunit/es6/templates.js
index
feb7364613db9391665f72700ea0608071945674..621b06074eeaf7c838c09057fea935484a175fe0
100644
--- a/test/mjsunit/es6/templates.js
+++ b/test/mjsunit/es6/templates.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-unicode
-
var num = 5;
var str = "str";
function fn() { return "result"; }
Index: test/mjsunit/es6/unicode-escapes.js
diff --git a/test/mjsunit/harmony/unicode-escapes.js
b/test/mjsunit/es6/unicode-escapes.js
similarity index 97%
rename from test/mjsunit/harmony/unicode-escapes.js
rename to test/mjsunit/es6/unicode-escapes.js
index
b39ee1a5b05f96c1c86f05a86da2b5c52691ec2d..be269366cf1a1f74749159c95255ffa00e8dd367
100644
--- a/test/mjsunit/harmony/unicode-escapes.js
+++ b/test/mjsunit/es6/unicode-escapes.js
@@ -4,8 +4,6 @@
// ES6 extends the \uxxxx escape and also allows \u{xxxxx}.
-// Flags: --harmony-unicode
-
// Unicode escapes in variable names.
(function TestVariableNames1() {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.