blob: e8feaf1cf1f762f22f584f74146b7e9c1d32a018 [file] [log] [blame]
// 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<JSReceiver>(newTarget));
const obj =
UnsafeCast<JSPrimitiveWrapper>(AllocateFastOrSlowJSObjectFromMap(map));
obj.value = value;
return obj;
}
}