Changeset 60708 in webkit for trunk/JavaScriptCore/runtime/ConstructData.cpp
- Timestamp:
- Jun 4, 2010, 2:38:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/ConstructData.cpp
r60392 r60708 34 34 namespace JSC { 35 35 36 JSObject* construct(ExecState* exec, JSValue object, ConstructType constructType, const ConstructData& constructData, const ArgList& args)36 JSObject* construct(ExecState* exec, JSValue constructorObject, ConstructType constructType, const ConstructData& constructData, const ArgList& args) 37 37 { 38 if (constructType == ConstructTypeHost) 39 return constructData.native.function(exec, asObject(object), args); 40 41 ASSERT(constructType == ConstructTypeJS); 42 JSFunction* jsFunction = asFunction(object); 43 44 ASSERT(!jsFunction->isHostFunction()); 45 Structure* structure; 46 JSValue prototype = jsFunction->get(exec, exec->propertyNames().prototype); 47 if (prototype.isObject()) 48 structure = asObject(prototype)->inheritorID(); 49 else 50 structure = exec->lexicalGlobalObject()->emptyObjectStructure(); 51 JSObject* thisObj = new (exec) JSObject(structure); 52 53 JSValue result = exec->interpreter()->executeConstruct(jsFunction->jsExecutable(), exec, jsFunction, thisObj, args, jsFunction->scope().node(), exec->exceptionSlot()); 54 if (exec->hadException() || !result.isObject()) 55 return thisObj; 56 return asObject(result); 38 ASSERT(constructType == ConstructTypeJS || constructType == ConstructTypeHost); 39 return exec->interpreter()->executeConstruct(exec, asObject(constructorObject), constructType, constructData, args, exec->exceptionSlot()); 57 40 } 58 41
Note:
See TracChangeset
for help on using the changeset viewer.