diff options
Diffstat (limited to 'deps/v8/src/builtins/builtins-boolean.cc')
-rw-r--r-- | deps/v8/src/builtins/builtins-boolean.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/deps/v8/src/builtins/builtins-boolean.cc b/deps/v8/src/builtins/builtins-boolean.cc index e0e1bb738c1..52645cbaa02 100644 --- a/deps/v8/src/builtins/builtins-boolean.cc +++ b/deps/v8/src/builtins/builtins-boolean.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "src/builtins/builtins-utils.h" +#include "src/builtins/builtins-utils-inl.h" #include "src/builtins/builtins.h" #include "src/counters.h" #include "src/objects-inl.h" @@ -19,19 +19,18 @@ BUILTIN(BooleanConstructor) { if (args.new_target()->IsUndefined(isolate)) { // [[Call]] Handle<Object> value = args.atOrUndefined(isolate, 1); return isolate->heap()->ToBoolean(value->BooleanValue(isolate)); - } else { // [[Construct]] - HandleScope scope(isolate); - Handle<Object> value = args.atOrUndefined(isolate, 1); - Handle<JSFunction> target = args.target(); - Handle<JSReceiver> new_target = Handle<JSReceiver>::cast(args.new_target()); - DCHECK(*target == target->native_context()->boolean_function()); - Handle<JSObject> result; - ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, - JSObject::New(target, new_target)); - Handle<JSValue>::cast(result)->set_value( - isolate->heap()->ToBoolean(value->BooleanValue(isolate))); - return *result; } + // [[Construct]] + Handle<Object> value = args.atOrUndefined(isolate, 1); + Handle<JSFunction> target = args.target(); + Handle<JSReceiver> new_target = Handle<JSReceiver>::cast(args.new_target()); + DCHECK(*target == target->native_context()->boolean_function()); + Handle<JSObject> result; + ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, + JSObject::New(target, new_target)); + Handle<JSValue>::cast(result)->set_value( + isolate->heap()->ToBoolean(value->BooleanValue(isolate))); + return *result; } } // namespace internal |