// ECMA 15.6.2 static EncodedJSValue JSC_HOST_CALL constructWithBooleanConstructor(ExecState* exec) { VM& vm = exec->vm(); auto scope = DECLARE_THROW_SCOPE(vm); JSValue boolean = jsBoolean(exec->argument(0).toBoolean(exec)); Structure* booleanStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), asInternalFunction(exec->callee())->globalObject()->booleanObjectStructure()); RETURN_IF_EXCEPTION(scope, encodedJSValue()); BooleanObject* obj = BooleanObject::create(vm, booleanStructure); obj->setInternalValue(vm, boolean); return JSValue::encode(obj); }
JSObject* constructBooleanFromImmediateBoolean(ExecState* exec, JSValue* immediateBooleanValue) { BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanPrototype()); obj->setInternalValue(immediateBooleanValue); return obj; }
// ECMA 15.6.2 JSObject* constructBoolean(ExecState* exec, const ArgList& args) { BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanPrototype()); obj->setInternalValue(jsBoolean(args.at(exec, 0)->toBoolean(exec))); return obj; }
JSObject* constructBooleanFromImmediateBoolean(ExecState* exec, JSGlobalObject* globalObject, JSValue immediateBooleanValue) { BooleanObject* obj = BooleanObject::create(exec->globalData(), globalObject->booleanObjectStructure()); obj->setInternalValue(exec->globalData(), immediateBooleanValue); return obj; }
// ECMA 15.6.2 JSObject* constructBoolean(ExecState* exec, const ArgList& args) { BooleanObject* obj = BooleanObject::create(exec->globalData(), asInternalFunction(exec->callee())->globalObject()->booleanObjectStructure()); obj->setInternalValue(exec->globalData(), jsBoolean(args.at(0).toBoolean(exec))); return obj; }