Changeset 34947 in webkit for trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
- Timestamp:
- Jul 2, 2008, 12:00:53 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r34754 r34947 30 30 #include "JSClassRef.h" 31 31 #include "JSGlobalObject.h" 32 #include "JSLock.h" 32 33 #include "JSObjectRef.h" 33 34 #include "JSString.h" … … 72 73 // initialize from base to derived 73 74 for (int i = static_cast<int>(initRoutines.size()) - 1; i >= 0; i--) { 74 JSLock::DropAllLocks dropAllLocks ;75 JSLock::DropAllLocks dropAllLocks(exec); 75 76 JSObjectInitializeCallback initialize = initRoutines[i]; 76 77 initialize(toRef(exec), toRef(this)); … … 110 111 // optional optimization to bypass getProperty in cases when we only need to know if the property exists 111 112 if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) { 112 JSLock::DropAllLocks dropAllLocks ;113 JSLock::DropAllLocks dropAllLocks(exec); 113 114 if (hasProperty(ctx, thisRef, propertyNameRef)) { 114 115 slot.setCustom(this, callbackGetter); … … 116 117 } 117 118 } else if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { 118 JSLock::DropAllLocks dropAllLocks ;119 JSLock::DropAllLocks dropAllLocks(exec); 119 120 if (JSValueRef value = getProperty(ctx, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) { 120 121 // cache the value so we don't have to compute it again … … 160 161 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 161 162 if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) { 162 JSLock::DropAllLocks dropAllLocks ;163 JSLock::DropAllLocks dropAllLocks(exec); 163 164 if (setProperty(ctx, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 164 165 return; … … 170 171 return; 171 172 if (JSObjectSetPropertyCallback setProperty = entry->setProperty) { 172 JSLock::DropAllLocks dropAllLocks ;173 JSLock::DropAllLocks dropAllLocks(exec); 173 174 if (setProperty(ctx, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 174 175 return; … … 206 207 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 207 208 if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) { 208 JSLock::DropAllLocks dropAllLocks ;209 JSLock::DropAllLocks dropAllLocks(exec); 209 210 if (deleteProperty(ctx, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 210 211 return true; … … 261 262 for (int i = 0; i < argumentCount; i++) 262 263 arguments[i] = toRef(args[i]); 263 JSLock::DropAllLocks dropAllLocks ;264 JSLock::DropAllLocks dropAllLocks(exec); 264 265 return toJS(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 265 266 } … … 288 289 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 289 290 if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstance) { 290 JSLock::DropAllLocks dropAllLocks ;291 JSLock::DropAllLocks dropAllLocks(exec); 291 292 return hasInstance(execRef, thisRef, toRef(value), toRef(exec->exceptionSlot())); 292 293 } … … 321 322 for (int i = 0; i < argumentCount; i++) 322 323 arguments[i] = toRef(args[i]); 323 JSLock::DropAllLocks dropAllLocks ;324 JSLock::DropAllLocks dropAllLocks(exec); 324 325 return toJS(callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 325 326 } … … 338 339 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 339 340 if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) { 340 JSLock::DropAllLocks dropAllLocks ;341 JSLock::DropAllLocks dropAllLocks(exec); 341 342 getPropertyNames(execRef, thisRef, toRef(&propertyNames)); 342 343 } … … 381 382 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 382 383 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { 383 JSLock::DropAllLocks dropAllLocks ;384 JSLock::DropAllLocks dropAllLocks(exec); 384 385 if (JSValueRef value = convertToType(ctx, thisRef, kJSTypeNumber, toRef(exec->exceptionSlot()))) 385 386 return toJS(value)->getNumber(); … … 399 400 JSValueRef value; 400 401 { 401 JSLock::DropAllLocks dropAllLocks ;402 JSLock::DropAllLocks dropAllLocks(exec); 402 403 value = convertToType(ctx, thisRef, kJSTypeString, toRef(exec->exceptionSlot())); 403 404 } … … 452 453 if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) 453 454 if (JSObjectGetPropertyCallback getProperty = entry->getProperty) { 454 JSLock::DropAllLocks dropAllLocks ;455 JSLock::DropAllLocks dropAllLocks(exec); 455 456 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 456 457 return toJS(value); … … 497 498 for (JSClassRef jsClass = thisObj->m_class; jsClass; jsClass = jsClass->parentClass) 498 499 if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { 499 JSLock::DropAllLocks dropAllLocks ;500 JSLock::DropAllLocks dropAllLocks(exec); 500 501 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 501 502 return toJS(value);
Note:
See TracChangeset
for help on using the changeset viewer.