// Copyright 2019 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. namespace boolean { javascript builtin BooleanConstructor( js-implicit context: Context, receiver: JSAny, newTarget: JSAny, target: JSFunction)(...arguments): JSAny { const value = SelectBooleanConstant(ToBoolean(arguments[0])); if (newTarget == Undefined) { return value; } const map = GetDerivedMap(target, UnsafeCast(newTarget)); const obj = UnsafeCast(AllocateFastOrSlowJSObjectFromMap(map)); obj.value = value; return obj; } }