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

Unified Diff: src/js/v8natives.js

Issue 2730573004: Revert of Migrate Object.prototype.valueOf to CSA (Closed)
Patch Set: Created 3 years, 10 months 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/debug/debug-evaluate.cc ('k') | test/cctest/test-serialize.cc » ('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 79a2fb761ed5ff57aaa3d7ee4a54e3b8c1de6c6d..29f9c45efa854360c259e620da1209d0a511e372 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -28,6 +28,12 @@
function ObjectToLocaleString() {
CHECK_OBJECT_COERCIBLE(this, "Object.prototype.toLocaleString");
return this.toString();
+}
+
+
+// ES6 19.1.3.7 Object.prototype.valueOf()
+function ObjectValueOf() {
+ return TO_OBJECT(this);
}
@@ -70,7 +76,7 @@
utils.InstallFunctions(GlobalObject.prototype, DONT_ENUM, [
"toString", ObjectToString,
"toLocaleString", ObjectToLocaleString,
- // valueOf is added in bootstrapper.cc.
+ "valueOf", ObjectValueOf,
"isPrototypeOf", ObjectIsPrototypeOf,
// propertyIsEnumerable is added in bootstrapper.cc.
// __defineGetter__ is added in bootstrapper.cc.
@@ -107,4 +113,8 @@
to.ObjectHasOwnProperty = GlobalObject.prototype.hasOwnProperty;
});
+%InstallToContext([
+ "object_value_of", ObjectValueOf,
+]);
+
})
« no previous file with comments | « src/debug/debug-evaluate.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698