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

Unified Diff: src/runtime.js

Issue 1346893003: [es6] Use the correct ToPrimitive in the Date Constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/macros.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index 9ace6ff821db13e977c9c1d387ef433f787805c3..e2eec4f17e9c61594c236846691d3047800657c6 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -21,7 +21,6 @@ var $toInteger;
var $toLength;
var $toNumber;
var $toPositiveInteger;
-var $toPrimitive;
var $toString;
var harmony_tolength = false;
@@ -176,15 +175,6 @@ function CONCAT_ITERABLE_TO_ARRAY(iterable) {
-------------------------------------
*/
-// ECMA-262, section 9.1, page 30. Use null/undefined for no hint,
-// (1) for number hint, and (2) for string hint.
-function ToPrimitive(x, hint) {
- if (!IS_SPEC_OBJECT(x)) return x;
- if (hint == NO_HINT) hint = (IS_DATE(x)) ? STRING_HINT : NUMBER_HINT;
- return (hint == NUMBER_HINT) ? DefaultNumber(x) : DefaultString(x);
-}
-
-
// ECMA-262, section 9.2, page 30
function ToBoolean(x) {
if (IS_BOOLEAN(x)) return x;
@@ -377,7 +367,6 @@ $toInteger = ToInteger;
$toLength = ToLength;
$toNumber = ToNumber;
$toPositiveInteger = ToPositiveInteger;
-$toPrimitive = ToPrimitive;
$toString = ToString;
%InstallToContext([
@@ -394,7 +383,6 @@ $toString = ToString;
"to_integer_fun", ToInteger,
"to_length_fun", ToLength,
"to_number_fun", ToNumber,
- "to_primitive", ToPrimitive,
"to_string_fun", ToString,
]);
@@ -402,7 +390,6 @@ utils.Export(function(to) {
to.ToBoolean = ToBoolean;
to.ToLength = ToLength;
to.ToNumber = ToNumber;
- to.ToPrimitive = ToPrimitive;
to.ToString = ToString;
});
« no previous file with comments | « src/macros.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698