Commit a373b089 authored by arv's avatar arv Committed by Commit bot

Remove --harmony-numeric-literal flag

We have been shipping harmony numeric literals since M41

R=rossberg@chromium.org
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#27545}
parent 21241680
......@@ -1658,7 +1658,6 @@ EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_classes)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object_literals)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_regexps)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_arrow_functions)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_numeric_literals)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_tostring)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sloppy)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode)
......@@ -1688,7 +1687,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_classes)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_literals)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_numeric_literals)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tostring)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy)
......@@ -2310,7 +2308,6 @@ bool Genesis::InstallExperimentalNatives() {
static const char* harmony_regexps_natives[] = {
"native harmony-regexp.js", NULL};
static const char* harmony_arrow_functions_natives[] = {NULL};
static const char* harmony_numeric_literals_natives[] = {NULL};
static const char* harmony_tostring_natives[] = {"native harmony-tostring.js",
NULL};
static const char* harmony_sloppy_natives[] = {NULL};
......
......@@ -202,7 +202,6 @@ DEFINE_IMPLICATION(es_staging, harmony)
// Features that are shipping (turned on by default, but internal flag remains).
#define HARMONY_SHIPPING(V) \
V(harmony_numeric_literals, "harmony numeric literals") \
V(harmony_classes, "harmony classes (implies object literal extension)") \
V(harmony_object_literals, "harmony object literal extensions")
......
......@@ -870,7 +870,6 @@ Parser::Parser(ParseInfo* info)
set_allow_natives(FLAG_allow_natives_syntax || info->is_native());
set_allow_harmony_modules(!info->is_native() && FLAG_harmony_modules);
set_allow_harmony_arrow_functions(FLAG_harmony_arrow_functions);
set_allow_harmony_numeric_literals(FLAG_harmony_numeric_literals);
set_allow_harmony_classes(FLAG_harmony_classes);
set_allow_harmony_object_literals(FLAG_harmony_object_literals);
set_allow_harmony_sloppy(FLAG_harmony_sloppy);
......@@ -4172,8 +4171,6 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
reusable_preparser_->set_allow_harmony_modules(allow_harmony_modules());
reusable_preparser_->set_allow_harmony_arrow_functions(
allow_harmony_arrow_functions());
reusable_preparser_->set_allow_harmony_numeric_literals(
allow_harmony_numeric_literals());
reusable_preparser_->set_allow_harmony_classes(allow_harmony_classes());
reusable_preparser_->set_allow_harmony_object_literals(
allow_harmony_object_literals());
......
......@@ -100,9 +100,6 @@ class ParserBase : public Traits {
return allow_harmony_arrow_functions_;
}
bool allow_harmony_modules() const { return scanner()->HarmonyModules(); }
bool allow_harmony_numeric_literals() const {
return scanner()->HarmonyNumericLiterals();
}
bool allow_harmony_classes() const { return scanner()->HarmonyClasses(); }
bool allow_harmony_object_literals() const {
return allow_harmony_object_literals_;
......@@ -128,9 +125,6 @@ class ParserBase : public Traits {
void set_allow_harmony_modules(bool allow) {
scanner()->SetHarmonyModules(allow);
}
void set_allow_harmony_numeric_literals(bool allow) {
scanner()->SetHarmonyNumericLiterals(allow);
}
void set_allow_harmony_classes(bool allow) {
scanner()->SetHarmonyClasses(allow);
}
......
......@@ -185,13 +185,7 @@ RUNTIME_FUNCTION(Runtime_StringToNumber) {
}
// Slower case.
int flags = ALLOW_HEX;
if (FLAG_harmony_numeric_literals) {
// The current spec draft has not updated "ToNumber Applied to the String
// Type", https://bugs.ecmascript.org/show_bug.cgi?id=1584
flags |= ALLOW_OCTAL | ALLOW_BINARY;
}
int flags = ALLOW_HEX | ALLOW_OCTAL | ALLOW_BINARY;
return *isolate->factory()->NewNumber(
StringToDouble(isolate->unicode_cache(), subject, flags));
}
......
......@@ -36,7 +36,6 @@ Scanner::Scanner(UnicodeCache* unicode_cache)
: unicode_cache_(unicode_cache),
octal_pos_(Location::invalid()),
harmony_modules_(false),
harmony_numeric_literals_(false),
harmony_classes_(false),
harmony_unicode_(false) {}
......@@ -954,7 +953,7 @@ Token::Value Scanner::ScanNumber(bool seen_period) {
while (IsHexDigit(c0_)) {
AddLiteralCharAdvance();
}
} else if (harmony_numeric_literals_ && (c0_ == 'o' || c0_ == 'O')) {
} else if (c0_ == 'o' || c0_ == 'O') {
kind = OCTAL;
AddLiteralCharAdvance();
if (!IsOctalDigit(c0_)) {
......@@ -964,7 +963,7 @@ Token::Value Scanner::ScanNumber(bool seen_period) {
while (IsOctalDigit(c0_)) {
AddLiteralCharAdvance();
}
} else if (harmony_numeric_literals_ && (c0_ == 'b' || c0_ == 'B')) {
} else if (c0_ == 'b' || c0_ == 'B') {
kind = BINARY;
AddLiteralCharAdvance();
if (!IsBinaryDigit(c0_)) {
......
......@@ -450,12 +450,6 @@ class Scanner {
void SetHarmonyModules(bool modules) {
harmony_modules_ = modules;
}
bool HarmonyNumericLiterals() const {
return harmony_numeric_literals_;
}
void SetHarmonyNumericLiterals(bool numeric_literals) {
harmony_numeric_literals_ = numeric_literals;
}
bool HarmonyClasses() const {
return harmony_classes_;
}
......@@ -739,8 +733,6 @@ class Scanner {
bool has_multiline_comment_before_next_;
// Whether we scan 'module', 'import', 'export' as keywords.
bool harmony_modules_;
// Whether we scan 0o777 and 0b111 as numbers.
bool harmony_numeric_literals_;
// Whether we scan 'class', 'extends', 'static' and 'super' as keywords.
bool harmony_classes_;
// Whether we allow \u{xxxxx}.
......
......@@ -1373,7 +1373,6 @@ enum ParserFlag {
kAllowLazy,
kAllowNatives,
kAllowHarmonyModules,
kAllowHarmonyNumericLiterals,
kAllowHarmonyArrowFunctions,
kAllowHarmonyClasses,
kAllowHarmonyObjectLiterals,
......@@ -1397,8 +1396,6 @@ void SetParserFlags(i::ParserBase<Traits>* parser,
parser->set_allow_lazy(flags.Contains(kAllowLazy));
parser->set_allow_natives(flags.Contains(kAllowNatives));
parser->set_allow_harmony_modules(flags.Contains(kAllowHarmonyModules));
parser->set_allow_harmony_numeric_literals(
flags.Contains(kAllowHarmonyNumericLiterals));
parser->set_allow_harmony_object_literals(
flags.Contains(kAllowHarmonyObjectLiterals));
parser->set_allow_harmony_arrow_functions(
......@@ -1668,9 +1665,8 @@ TEST(ParserSync) {
// Neither Harmony numeric literals nor our natives syntax have any
// interaction with the flags above, so test these separately to reduce
// the combinatorial explosion.
static const ParserFlag flags2[] = { kAllowHarmonyNumericLiterals };
TestParserSync("0o1234", flags2, arraysize(flags2));
TestParserSync("0b1011", flags2, arraysize(flags2));
TestParserSync("0o1234", NULL, 0);
TestParserSync("0b1011", NULL, 0);
static const ParserFlag flags3[] = { kAllowNatives };
TestParserSync("%DebugPrint(123)", flags3, arraysize(flags3));
......@@ -4262,7 +4258,6 @@ TEST(ClassDeclarationErrors) {
static const ParserFlag always_flags[] = {
kAllowHarmonyClasses,
kAllowHarmonyNumericLiterals,
kAllowHarmonySloppy
};
RunParserSyncTest(context_data, class_data, kError, NULL, 0,
......
......@@ -25,8 +25,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --harmony-numeric-literals
function TestOctalLiteral() {
assertEquals(0, 0o0);
assertEquals(0, 0O0);
......@@ -69,8 +67,6 @@ function TestBinaryLiteralUsingNumberFunction() {
TestBinaryLiteralUsingNumberFunction();
// parseInt should (probably) not support 0b and 0o.
// https://bugs.ecmascript.org/show_bug.cgi?id=1585
function TestParseIntDoesNotSupportOctalNorBinary() {
assertEquals(0, parseInt('0o77'));
assertEquals(0, parseInt('0o77', 8));
......
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