X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174:/runtime/ConstructData.cpp diff --git a/runtime/ConstructData.cpp b/runtime/ConstructData.cpp index 7ee59d7..5da2a91 100644 --- a/runtime/ConstructData.cpp +++ b/runtime/ConstructData.cpp @@ -26,17 +26,17 @@ #include "config.h" #include "ConstructData.h" +#include "Executable.h" +#include "Interpreter.h" #include "JSFunction.h" +#include "JSGlobalObject.h" namespace JSC { -JSObject* construct(ExecState* exec, JSValue object, ConstructType constructType, const ConstructData& constructData, const ArgList& args) +JSObject* construct(ExecState* exec, JSValue constructorObject, ConstructType constructType, const ConstructData& constructData, const ArgList& args) { - if (constructType == ConstructTypeHost) - return constructData.native.function(exec, asObject(object), args); - ASSERT(constructType == ConstructTypeJS); - // FIXME: Can this be done more efficiently using the constructData? - return asFunction(object)->construct(exec, args); + ASSERT(constructType == ConstructTypeJS || constructType == ConstructTypeHost); + return exec->interpreter()->executeConstruct(exec, asObject(constructorObject), constructType, constructData, args); } } // namespace JSC