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

Unified Diff: src/date.js

Issue 1324713002: [es6] Implement Date.prototype[@@toPrimitive] as C++ builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Michi's comments. Created 5 years, 4 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/compiler/linkage.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date.js
diff --git a/src/date.js b/src/date.js
index 5df3afa98b7d5207c86c525f83070ad4c12919c3..4f49565e603b0acbd0b2a8215874d4abfa410da5 100644
--- a/src/date.js
+++ b/src/date.js
@@ -365,21 +365,6 @@ function DateToLocaleTimeString() {
}
-// 20.3.4.45 Date.prototype [ @@toPrimitive ] ( hint )
-function DateToPrimitive(hint) {
- if (!IS_SPEC_OBJECT(this)) {
- throw MakeTypeError(kIncompatibleMethodReceiver,
- "Date.prototype [ @@toPrimitive ]", this);
- }
- if (hint === "default") {
- hint = "string";
- } else if (hint !== "number" && hint !== "string") {
- throw MakeTypeError(kInvalidHint, hint);
- }
- return %OrdinaryToPrimitive(this, hint);
-}
-
-
// ECMA 262 - 15.9.5.8
function DateValueOf() {
CHECK_DATE(this);
@@ -848,9 +833,6 @@ utils.InstallFunctions(GlobalDate, DONT_ENUM, [
// Set up non-enumerable constructor property of the Date prototype object.
%AddNamedProperty(GlobalDate.prototype, "constructor", GlobalDate, DONT_ENUM);
-utils.SetFunctionName(DateToPrimitive, toPrimitiveSymbol);
-%AddNamedProperty(GlobalDate.prototype, toPrimitiveSymbol, DateToPrimitive,
- DONT_ENUM | READ_ONLY);
// Set up non-enumerable functions of the Date prototype object and
// set their names.
« no previous file with comments | « src/compiler/linkage.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698