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

Unified Diff: src/v8natives.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/runtime.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index a0c6b5b67d3fca6ab7310f76f2af067030fcff3a..34c35031b2601dd4c1ef614c877668d307502569 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -22,7 +22,6 @@ var ProxyDelegateCallAndConstruct;
var ProxyDerivedHasOwnTrap;
var ProxyDerivedKeysTrap;
var StringIndexOf;
-var ToBoolean = utils.ImportNow("ToBoolean");
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
@@ -348,11 +347,11 @@ function ToPropertyDescriptor(obj) {
var desc = new PropertyDescriptor();
if ("enumerable" in obj) {
- desc.setEnumerable(ToBoolean(obj.enumerable));
+ desc.setEnumerable(TO_BOOLEAN(obj.enumerable));
}
if ("configurable" in obj) {
- desc.setConfigurable(ToBoolean(obj.configurable));
+ desc.setConfigurable(TO_BOOLEAN(obj.configurable));
}
if ("value" in obj) {
@@ -360,7 +359,7 @@ function ToPropertyDescriptor(obj) {
}
if ("writable" in obj) {
- desc.setWritable(ToBoolean(obj.writable));
+ desc.setWritable(TO_BOOLEAN(obj.writable));
}
if ("get" in obj) {
@@ -614,7 +613,7 @@ function DefineProxyProperty(obj, p, attributes, should_throw) {
var handler = %GetHandler(obj);
var result = CallTrap2(handler, "defineProperty", UNDEFINED, p, attributes);
- if (!ToBoolean(result)) {
+ if (!result) {
if (should_throw) {
throw MakeTypeError(kProxyHandlerReturned,
handler, "false", "defineProperty");
@@ -1372,9 +1371,9 @@ function BooleanConstructor(x) {
// TODO(bmeurer): Move this to toplevel.
"use strict";
if (%_IsConstructCall()) {
- %_SetValueOf(this, ToBoolean(x));
+ %_SetValueOf(this, TO_BOOLEAN(x));
} else {
- return ToBoolean(x);
+ return TO_BOOLEAN(x);
}
}
« no previous file with comments | « src/runtime.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698