Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Unified Diff: src/js/v8natives.js

Issue 1509533003: Rewrite Object.prototype.toString in C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase, add back experimental flag Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/prologue.js ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/v8natives.js
diff --git a/src/js/v8natives.js b/src/js/v8natives.js
index 1ae6e4832029b3354503b2711064290cb3fa85d0..edada890411815af9795f6eaebba1b6b53d3e923 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -9,7 +9,6 @@
// ----------------------------------------------------------------------------
// Imports
-var FLAG_harmony_tostring;
var GlobalArray = global.Array;
var GlobalBoolean = global.Boolean;
var GlobalFunction = global.Function;
@@ -22,6 +21,7 @@ var MakeSyntaxError;
var MakeTypeError;
var MathAbs;
var NaN = %GetRootNaN();
+var ObjectToString = utils.ImportNow("object_to_string");
var ObserveBeginPerformSplice;
var ObserveEndPerformSplice;
var ObserveEnqueueSpliceRecord;
@@ -40,10 +40,6 @@ utils.Import(function(from) {
StringIndexOf = from.StringIndexOf;
});
-utils.ImportFromExperimental(function(from) {
- FLAG_harmony_tostring = from.FLAG_harmony_tostring;
-});
-
// ----------------------------------------------------------------------------
@@ -144,28 +140,6 @@ utils.InstallFunctions(global, DONT_ENUM, [
// ----------------------------------------------------------------------------
// Object
-// ES6 19.1.3.6 Object.prototype.toString()
-function ObjectToString() {
- if (IS_UNDEFINED(this)) return "[object Undefined]";
- if (IS_NULL(this)) return "[object Null]";
- var O = TO_OBJECT(this);
- var builtinTag = %_ClassOf(O);
- var tag;
-
- // TODO(caitp): cannot wait to get rid of this flag :>
- if (FLAG_harmony_tostring) {
- tag = O[toStringTagSymbol];
- if (!IS_STRING(tag)) {
- tag = builtinTag;
- }
- } else {
- tag = builtinTag;
- }
-
- return `[object ${tag}]`;
-}
-
-
// ES6 19.1.3.5 Object.prototype.toLocaleString([reserved1 [,reserved2]])
function ObjectToLocaleString() {
CHECK_OBJECT_COERCIBLE(this, "Object.prototype.toLocaleString");
@@ -1515,13 +1489,11 @@ utils.Export(function(to) {
to.ObjectIsFrozen = ObjectIsFrozen;
to.ObjectIsSealed = ObjectIsSealed;
to.ObjectKeys = ObjectKeys;
- to.ObjectToString = ObjectToString;
});
%InstallToContext([
"global_eval_fun", GlobalEval,
"object_value_of", ObjectValueOf,
- "object_to_string", ObjectToString,
]);
})
« no previous file with comments | « src/js/prologue.js ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698