Changeset 36726 in webkit for trunk/JavaScriptCore/API/JSObjectRef.cpp
- Timestamp:
- Sep 20, 2008, 7:29:12 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSObjectRef.cpp
r36263 r36726 73 73 74 74 if (!jsClass) 75 return toRef(new (exec) JSObject(exec->lexicalGlobalObject()-> objectPrototype())); // slightly more efficient76 77 JS Object* jsPrototype = jsClass->prototype(exec);78 if ( !jsPrototype)79 jsPrototype = exec->lexicalGlobalObject()->objectPrototype();80 81 return toRef( new (exec) JSCallbackObject<JSObject>(exec, jsClass, jsPrototype, data));75 return toRef(new (exec) JSObject(exec->lexicalGlobalObject()->emptyObjectStructure())); // slightly more efficient 76 77 JSCallbackObject<JSObject>* object = new (exec) JSCallbackObject<JSObject>(exec, exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); 78 if (JSObject* prototype = jsClass->prototype(exec)) 79 object->setPrototype(prototype); 80 81 return toRef(object); 82 82 } 83 83 … … 103 103 : exec->dynamicGlobalObject()->objectPrototype(); 104 104 105 JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec , jsClass, callAsConstructor);105 JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor); 106 106 constructor->putDirect(exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly); 107 107 return toRef(constructor);
Note:
See TracChangeset
for help on using the changeset viewer.