Remove --harmony-tostring runtime flag
ES2015 Object.prototype.toString semantics were enabled in version 4.9, which has been in stable Chrome for nearly two weeks at this point. R=littledan@chromium.org Review URL: https://codereview.chromium.org/1784033002 Cr-Commit-Position: refs/heads/master@{#34732}
This commit is contained in:
parent
515105a700
commit
b16fc86389
@ -2251,7 +2251,6 @@ void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate,
|
||||
isolate->factory()->ToBoolean(FLAG), NONE); \
|
||||
}
|
||||
|
||||
INITIALIZE_FLAG(FLAG_harmony_tostring)
|
||||
INITIALIZE_FLAG(FLAG_harmony_species)
|
||||
|
||||
#undef INITIALIZE_FLAG
|
||||
@ -2293,13 +2292,6 @@ void InstallPublicSymbol(Factory* factory, Handle<Context> native_context,
|
||||
}
|
||||
|
||||
|
||||
void Genesis::InitializeGlobal_harmony_tostring() {
|
||||
if (!FLAG_harmony_tostring) return;
|
||||
InstallPublicSymbol(factory(), native_context(), "toStringTag",
|
||||
factory()->to_string_tag_symbol());
|
||||
}
|
||||
|
||||
|
||||
void Genesis::InitializeGlobal_harmony_regexp_subclass() {
|
||||
if (!FLAG_harmony_regexp_subclass) return;
|
||||
InstallPublicSymbol(factory(), native_context(), "match",
|
||||
@ -2957,7 +2949,6 @@ bool Genesis::InstallExperimentalNatives() {
|
||||
static const char* harmony_modules_natives[] = {nullptr};
|
||||
static const char* harmony_regexps_natives[] = {"native harmony-regexp.js",
|
||||
nullptr};
|
||||
static const char* harmony_tostring_natives[] = {nullptr};
|
||||
static const char* harmony_iterator_close_natives[] = {nullptr};
|
||||
static const char* harmony_sloppy_natives[] = {nullptr};
|
||||
static const char* harmony_sloppy_function_natives[] = {nullptr};
|
||||
|
@ -223,7 +223,6 @@ DEFINE_IMPLICATION(es_staging, harmony_tailcalls)
|
||||
#define HARMONY_SHIPPING(V) \
|
||||
V(harmony_function_name, "harmony Function name inference") \
|
||||
V(harmony_iterator_close, "harmony iterator finalization") \
|
||||
V(harmony_tostring, "harmony toString") \
|
||||
V(harmony_regexps, "harmony regular expression extensions") \
|
||||
V(harmony_unicode_regexps, "harmony unicode regexps") \
|
||||
V(harmony_sloppy, "harmony features in sloppy mode") \
|
||||
|
@ -23,7 +23,6 @@ var callSitePositionSymbol =
|
||||
utils.ImportNow("call_site_position_symbol");
|
||||
var callSiteStrictSymbol =
|
||||
utils.ImportNow("call_site_strict_symbol");
|
||||
var FLAG_harmony_tostring;
|
||||
var Float32x4ToString;
|
||||
var formattedStackTraceSymbol =
|
||||
utils.ImportNow("formatted_stack_trace_symbol");
|
||||
@ -67,10 +66,6 @@ utils.Import(function(from) {
|
||||
Uint8x16ToString = from.Uint8x16ToString;
|
||||
});
|
||||
|
||||
utils.ImportFromExperimental(function(from) {
|
||||
FLAG_harmony_tostring = from.FLAG_harmony_tostring;
|
||||
});
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
var GlobalError;
|
||||
@ -87,13 +82,8 @@ function NoSideEffectsObjectToString() {
|
||||
if (IS_NULL(this)) return "[object Null]";
|
||||
var O = TO_OBJECT(this);
|
||||
var builtinTag = %_ClassOf(O);
|
||||
var tag;
|
||||
if (FLAG_harmony_tostring) {
|
||||
tag = %GetDataProperty(O, toStringTagSymbol);
|
||||
if (!IS_STRING(tag)) {
|
||||
tag = builtinTag;
|
||||
}
|
||||
} else {
|
||||
var tag = %GetDataProperty(O, toStringTagSymbol);
|
||||
if (!IS_STRING(tag)) {
|
||||
tag = builtinTag;
|
||||
}
|
||||
return `[object ${tag}]`;
|
||||
|
@ -84,9 +84,7 @@ utils.InstallConstants(GlobalSymbol, [
|
||||
// "search", searchSymbol,
|
||||
// "split, splitSymbol,
|
||||
"toPrimitive", toPrimitiveSymbol,
|
||||
// TODO(dslomov, caitp): Currently defined in harmony-tostring.js ---
|
||||
// Move here when shipping
|
||||
// "toStringTag", toStringTagSymbol,
|
||||
"toStringTag", toStringTagSymbol,
|
||||
"unscopables", unscopablesSymbol,
|
||||
]);
|
||||
|
||||
|
@ -2463,11 +2463,9 @@ Handle<String> JSReceiver::GetConstructorName(Handle<JSReceiver> receiver) {
|
||||
}
|
||||
}
|
||||
|
||||
if (FLAG_harmony_tostring) {
|
||||
Handle<Object> maybe_tag = JSReceiver::GetDataProperty(
|
||||
receiver, isolate->factory()->to_string_tag_symbol());
|
||||
if (maybe_tag->IsString()) return Handle<String>::cast(maybe_tag);
|
||||
}
|
||||
Handle<Object> maybe_tag = JSReceiver::GetDataProperty(
|
||||
receiver, isolate->factory()->to_string_tag_symbol());
|
||||
if (maybe_tag->IsString()) return Handle<String>::cast(maybe_tag);
|
||||
|
||||
PrototypeIterator iter(isolate, receiver);
|
||||
if (iter.IsAtEnd()) return handle(receiver->class_name());
|
||||
@ -16647,16 +16645,14 @@ MaybeHandle<String> Object::ObjectProtoToString(Isolate* isolate,
|
||||
Object::ToObject(isolate, object).ToHandleChecked();
|
||||
|
||||
Handle<String> tag;
|
||||
if (FLAG_harmony_tostring) {
|
||||
Handle<Object> to_string_tag;
|
||||
ASSIGN_RETURN_ON_EXCEPTION(
|
||||
isolate, to_string_tag,
|
||||
JSReceiver::GetProperty(receiver,
|
||||
isolate->factory()->to_string_tag_symbol()),
|
||||
String);
|
||||
if (to_string_tag->IsString()) {
|
||||
tag = Handle<String>::cast(to_string_tag);
|
||||
}
|
||||
Handle<Object> to_string_tag;
|
||||
ASSIGN_RETURN_ON_EXCEPTION(
|
||||
isolate, to_string_tag,
|
||||
JSReceiver::GetProperty(receiver,
|
||||
isolate->factory()->to_string_tag_symbol()),
|
||||
String);
|
||||
if (to_string_tag->IsString()) {
|
||||
tag = Handle<String>::cast(to_string_tag);
|
||||
}
|
||||
|
||||
if (tag.is_null()) {
|
||||
|
@ -13300,8 +13300,6 @@ THREADED_TEST(ObjectProtoToString) {
|
||||
|
||||
|
||||
TEST(ObjectProtoToStringES6) {
|
||||
// TODO(dslomov, caitp): merge into ObjectProtoToString test once shipped.
|
||||
i::FLAG_harmony_tostring = true;
|
||||
LocalContext context;
|
||||
v8::Isolate* isolate = CcTest::isolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
@ -24759,7 +24757,6 @@ TEST(AccessCheckedIsConcatSpreadable) {
|
||||
|
||||
|
||||
TEST(AccessCheckedToStringTag) {
|
||||
i::FLAG_harmony_tostring = true;
|
||||
v8::Isolate* isolate = CcTest::isolate();
|
||||
HandleScope scope(isolate);
|
||||
LocalContext env;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-tostring
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
function le(a, b) {
|
||||
return a <= b;
|
||||
|
@ -25,7 +25,7 @@
|
||||
// (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: --allow-natives-syntax --harmony-tostring
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
|
||||
var NONE = 0;
|
||||
|
@ -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-tostring
|
||||
|
||||
var global = this;
|
||||
|
||||
var funs = {
|
||||
|
@ -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-tostring
|
||||
|
||||
'use strict';
|
||||
|
||||
function assertGetterName(expected, object, name) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-tostring
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
|
||||
(function TestSetIterator() {
|
||||
|
@ -25,7 +25,7 @@
|
||||
// (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: --expose-gc --allow-natives-syntax --harmony-tostring
|
||||
// Flags: --expose-gc --allow-natives-syntax
|
||||
|
||||
|
||||
function assertSize(expected, collection) {
|
||||
|
@ -25,7 +25,7 @@
|
||||
// (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: --allow-natives-syntax --harmony-tostring
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
// Test instantations of generators.
|
||||
|
||||
|
@ -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-tostring
|
||||
|
||||
function testJSONToString() {
|
||||
assertEquals('[object JSON]', "" + JSON);
|
||||
assertEquals("JSON", JSON[Symbol.toStringTag]);
|
||||
|
@ -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-tostring
|
||||
|
||||
function testMathToString() {
|
||||
assertEquals('[object Math]', "" + Math);
|
||||
assertEquals("Math", Math[Symbol.toStringTag]);
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-tostring --harmony-proxies
|
||||
// Flags: --harmony-proxies
|
||||
|
||||
var global = this;
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
// (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: --allow-natives-syntax --harmony-tostring --promise-extra
|
||||
// Flags: --allow-natives-syntax --promise-extra
|
||||
|
||||
// Make sure we don't rely on functions patchable by monkeys.
|
||||
var call = Function.prototype.call.call.bind(Function.prototype.call)
|
||||
|
@ -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-tostring
|
||||
|
||||
function TestStringPrototypeIterator() {
|
||||
assertTrue(String.prototype.hasOwnProperty(Symbol.iterator));
|
||||
assertFalse("".hasOwnProperty(Symbol.iterator));
|
||||
|
@ -25,7 +25,7 @@
|
||||
// (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: --expose-gc --allow-natives-syntax --harmony-tostring
|
||||
// Flags: --expose-gc --allow-natives-syntax
|
||||
|
||||
var symbols = []
|
||||
|
||||
|
@ -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-tostring
|
||||
|
||||
// ArrayBuffer
|
||||
|
||||
function TestByteLength(param, expectedByteLength) {
|
||||
|
@ -25,7 +25,7 @@
|
||||
// (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-sharedarraybuffer --harmony-tostring
|
||||
// Flags: --harmony-sharedarraybuffer
|
||||
|
||||
|
||||
// SharedArrayBuffer
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-simd --harmony-tostring --harmony-reflect
|
||||
// Flags: --harmony-simd --harmony-reflect
|
||||
// Flags: --allow-natives-syntax --expose-natives-as natives --noalways-opt
|
||||
|
||||
function lanesForType(typeName) {
|
||||
|
Loading…
Reference in New Issue
Block a user