]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/ConstructData.cpp
JavaScriptCore-1097.13.tar.gz
[apple/javascriptcore.git] / runtime / ConstructData.cpp
index 7a729ae33787d283f42f819328eae4b34efc0c54..5da2a911cc5177a0d9bda27ebb5be8d6ef8d2de2 100644 (file)
 #include "config.h"
 #include "ConstructData.h"
 
+#include "Executable.h"
+#include "Interpreter.h"
 #include "JSFunction.h"
+#include "JSGlobalObject.h"
 
 namespace JSC {
 
-JSObject* construct(ExecState* exec, JSValuePtr 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