diff options
Diffstat (limited to 'deps/v8/src/builtins/boolean.tq')
-rw-r--r-- | deps/v8/src/builtins/boolean.tq | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/deps/v8/src/builtins/boolean.tq b/deps/v8/src/builtins/boolean.tq index c8f0d8134ac..40a011d4e09 100644 --- a/deps/v8/src/builtins/boolean.tq +++ b/deps/v8/src/builtins/boolean.tq @@ -3,43 +3,43 @@ // found in the LICENSE file. namespace boolean { - transitioning macro ThisBooleanValue(implicit context: Context)( - receiver: JSAny, method: constexpr string): Boolean { - return UnsafeCast<Boolean>( - ToThisValue(receiver, PrimitiveType::kBoolean, method)); - } +transitioning macro ThisBooleanValue(implicit context: Context)( + receiver: JSAny, method: constexpr string): Boolean { + return UnsafeCast<Boolean>( + ToThisValue(receiver, PrimitiveType::kBoolean, method)); +} - javascript builtin - BooleanConstructor( - js-implicit context: NativeContext, receiver: JSAny, newTarget: JSAny, - target: JSFunction)(...arguments): JSAny { - const value = SelectBooleanConstant(ToBoolean(arguments[0])); +javascript builtin +BooleanConstructor( + js-implicit context: NativeContext, receiver: JSAny, newTarget: JSAny, + target: JSFunction)(...arguments): JSAny { + const value = SelectBooleanConstant(ToBoolean(arguments[0])); - if (newTarget == Undefined) { - return value; - } + if (newTarget == Undefined) { + return value; + } - const map = GetDerivedMap(target, UnsafeCast<JSReceiver>(newTarget)); + const map = GetDerivedMap(target, UnsafeCast<JSReceiver>(newTarget)); - const obj = - UnsafeCast<JSPrimitiveWrapper>(AllocateFastOrSlowJSObjectFromMap(map)); - obj.value = value; - return obj; - } + const obj = + UnsafeCast<JSPrimitiveWrapper>(AllocateFastOrSlowJSObjectFromMap(map)); + obj.value = value; + return obj; +} - // ES #sec-boolean.prototype.tostring - transitioning javascript builtin BooleanPrototypeToString( - js-implicit context: NativeContext, receiver: JSAny)(): JSAny { - // 1. Let b be ? thisBooleanValue(this value). - const b = ThisBooleanValue(receiver, 'Boolean.prototype.toString'); - // 2. If b is true, return "true"; else return "false". - return b.to_string; - } +// ES #sec-boolean.prototype.tostring +transitioning javascript builtin BooleanPrototypeToString( + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { + // 1. Let b be ? thisBooleanValue(this value). + const b = ThisBooleanValue(receiver, 'Boolean.prototype.toString'); + // 2. If b is true, return "true"; else return "false". + return b.to_string; +} - // ES #sec-boolean.prototype.valueof - transitioning javascript builtin BooleanPrototypeValueOf( - js-implicit context: NativeContext, receiver: JSAny)(): JSAny { - // 1. Return ? thisBooleanValue(this value). - return ThisBooleanValue(receiver, 'Boolean.prototype.valueOf'); - } +// ES #sec-boolean.prototype.valueof +transitioning javascript builtin BooleanPrototypeValueOf( + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { + // 1. Return ? thisBooleanValue(this value). + return ThisBooleanValue(receiver, 'Boolean.prototype.valueOf'); +} } |