X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63:/runtime/NativeErrorConstructor.cpp diff --git a/runtime/NativeErrorConstructor.cpp b/runtime/NativeErrorConstructor.cpp index eee9890..403fc7e 100644 --- a/runtime/NativeErrorConstructor.cpp +++ b/runtime/NativeErrorConstructor.cpp @@ -32,8 +32,8 @@ ASSERT_CLASS_FITS_IN_CELL(NativeErrorConstructor); const ClassInfo NativeErrorConstructor::info = { "Function", &InternalFunction::info, 0, 0 }; -NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, PassRefPtr structure, NativeErrorPrototype* nativeErrorPrototype) - : InternalFunction(&exec->globalData(), structure, Identifier(exec, nativeErrorPrototype->getDirect(exec->propertyNames().name).getString())) +NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, NonNullPassRefPtr structure, NativeErrorPrototype* nativeErrorPrototype) + : InternalFunction(&exec->globalData(), structure, Identifier(exec, nativeErrorPrototype->getDirect(exec->propertyNames().name).getString(exec))) , m_errorStructure(ErrorInstance::createStructure(nativeErrorPrototype)) { putDirect(exec->propertyNames().length, jsNumber(exec, 1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5 @@ -43,8 +43,8 @@ NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, PassRefPtrputDirect(exec->propertyNames().message, jsString(exec, args.at(exec, 0).toString(exec))); + if (!args.at(0).isUndefined()) + object->putDirect(exec->propertyNames().message, jsString(exec, args.at(0).toString(exec))); return object; } @@ -58,8 +58,8 @@ ConstructType NativeErrorConstructor::getConstructData(ConstructData& constructD constructData.native.function = constructWithNativeErrorConstructor; return ConstructTypeHost; } - -static JSValuePtr callNativeErrorConstructor(ExecState* exec, JSObject* constructor, JSValuePtr, const ArgList& args) + +static JSValue JSC_HOST_CALL callNativeErrorConstructor(ExecState* exec, JSObject* constructor, JSValue, const ArgList& args) { return static_cast(constructor)->construct(exec, args); }