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

Unified Diff: src/runtime.js

Issue 1400463002: [builtins] Drop useless ToBoolean JavaScript builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adding ( ) to macros.py. Created 5 years, 2 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/prologue.js ('k') | src/v8natives.js » ('j') | 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 c0e85529025cf63a554266dd0fd7a844ac762c4b..5a4c75a42a4db01b24f76044654640977f9a561d 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -166,16 +166,6 @@ function CONCAT_ITERABLE_TO_ARRAY(iterable) {
-------------------------------------
*/
-// ECMA-262, section 9.2, page 30
-function ToBoolean(x) {
- if (IS_BOOLEAN(x)) return x;
- if (IS_STRING(x)) return x.length != 0;
- if (x == null) return false;
- if (IS_NUMBER(x)) return !((x == 0) || NUMBER_IS_NAN(x));
- return true;
-}
-
-
// ES5, section 9.12
function SameValue(x, y) {
if (typeof x != typeof y) return false;
@@ -222,7 +212,7 @@ function IsConcatSpreadable(O) {
if (!IS_SPEC_OBJECT(O)) return false;
var spreadable = O[isConcatSpreadableSymbol];
if (IS_UNDEFINED(spreadable)) return IS_ARRAY(O);
- return ToBoolean(spreadable);
+ return TO_BOOLEAN(spreadable);
}
@@ -260,8 +250,4 @@ $toPositiveInteger = ToPositiveInteger;
"concat_iterable_to_array", ConcatIterableToArray,
]);
-utils.Export(function(to) {
- to.ToBoolean = ToBoolean;
-});
-
})
« no previous file with comments | « src/prologue.js ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698