Changeset 15317 in webkit for trunk/JavaScriptCore/API/JSCallbackObject.cpp
- Timestamp:
- Jul 10, 2006, 5:26:25 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackObject.cpp
r15310 r15317 52 52 void JSCallbackObject::init(JSContextRef context, JSClassRef jsClass) 53 53 { 54 ExecState* exec = toJS(context); 55 54 56 m_privateData = 0; 55 57 m_class = JSClassRetain(jsClass); … … 59 61 do { 60 62 if (JSInitializeCallback initialize = jsClass->callbacks.initialize) 61 initialize(context, thisRef );63 initialize(context, thisRef, toRef(exec->exceptionSlot())); 62 64 } while ((jsClass = jsClass->parent)); 63 65 } … … 84 86 JSObjectRef thisRef = toRef(this); 85 87 JSInternalStringRef propertyNameRef = toRef(propertyName.ustring().rep()); 86 88 87 89 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parent) { 88 90 // optional optimization to bypass getProperty in cases when we only need to know if the property exists 89 91 if (JSHasPropertyCallback hasPropertyCallback = jsClass->callbacks.hasProperty) { 90 if (hasPropertyCallback(context, thisRef, propertyNameRef )) {92 if (hasPropertyCallback(context, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) { 91 93 slot.setCustom(this, callbackGetter); 92 94 return true; … … 94 96 } else if (JSGetPropertyCallback getPropertyCallback = jsClass->callbacks.getProperty) { 95 97 JSValueRef returnValue; 96 if (getPropertyCallback(context, thisRef, propertyNameRef, &returnValue )) {98 if (getPropertyCallback(context, thisRef, propertyNameRef, &returnValue, toRef(exec->exceptionSlot()))) { 97 99 // cache the value so we don't have to compute it again 98 100 // FIXME: This violates the PropertySlot design a little bit. … … 137 139 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parent) { 138 140 if (JSSetPropertyCallback setPropertyCallback = jsClass->callbacks.setProperty) { 139 if (setPropertyCallback(context, thisRef, propertyNameRef, valueRef ))141 if (setPropertyCallback(context, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 140 142 return; 141 143 } … … 146 148 return; 147 149 if (JSSetPropertyCallback setPropertyCallback = entry->setProperty) { 148 if (setPropertyCallback(context, thisRef, propertyNameRef, valueRef ))150 if (setPropertyCallback(context, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 149 151 return; 150 152 } … … 177 179 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parent) { 178 180 if (JSDeletePropertyCallback deletePropertyCallback = jsClass->callbacks.deleteProperty) { 179 if (deletePropertyCallback(context, thisRef, propertyNameRef ))181 if (deletePropertyCallback(context, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 180 182 return true; 181 183 } … … 225 227 for (size_t i = 0; i < argc; i++) 226 228 argv[i] = toRef(args[i]); 227 return toJS(callAsConstructorCallback(execRef, thisRef, argc, argv ));229 return toJS(callAsConstructorCallback(execRef, thisRef, argc, argv, toRef(exec->exceptionSlot()))); 228 230 } 229 231 } … … 254 256 for (size_t i = 0; i < argc; i++) 255 257 argv[i] = toRef(args[i]); 256 return toJS(callAsFunctionCallback(execRef, thisRef, thisObjRef, argc, argv ));258 return toJS(callAsFunctionCallback(execRef, thisRef, thisObjRef, argc, argv, toRef(exec->exceptionSlot()))); 257 259 } 258 260 } … … 269 271 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parent) { 270 272 if (JSGetPropertyListCallback getPropertyListCallback = jsClass->callbacks.getPropertyList) 271 getPropertyListCallback(context, thisRef, toRef(&propertyList) );273 getPropertyListCallback(context, thisRef, toRef(&propertyList), toRef(exec->exceptionSlot())); 272 274 273 275 if (__JSClass::StaticValuesTable* staticValues = jsClass->staticValues) { … … 305 307 if (JSConvertToTypeCallback convertToTypeCallback = jsClass->callbacks.convertToType) { 306 308 JSValueRef returnValue; 307 if (convertToTypeCallback(context, thisRef, kJSTypeBoolean, &returnValue ))309 if (convertToTypeCallback(context, thisRef, kJSTypeBoolean, &returnValue, toRef(exec->exceptionSlot()))) 308 310 return toJS(returnValue)->getBoolean(); 309 311 } … … 320 322 if (JSConvertToTypeCallback convertToTypeCallback = jsClass->callbacks.convertToType) { 321 323 JSValueRef returnValue; 322 if (convertToTypeCallback(context, thisRef, kJSTypeNumber, &returnValue ))324 if (convertToTypeCallback(context, thisRef, kJSTypeNumber, &returnValue, toRef(exec->exceptionSlot()))) 323 325 return toJS(returnValue)->getNumber(); 324 326 } … … 335 337 if (JSConvertToTypeCallback convertToTypeCallback = jsClass->callbacks.convertToType) { 336 338 JSValueRef returnValue; 337 if (convertToTypeCallback(context, thisRef, kJSTypeString, &returnValue ))339 if (convertToTypeCallback(context, thisRef, kJSTypeString, &returnValue, toRef(exec->exceptionSlot()))) 338 340 return toJS(returnValue)->getString(); 339 341 } … … 381 383 if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) 382 384 if (JSGetPropertyCallback getPropertyCallback = entry->getProperty) 383 if (getPropertyCallback(toRef(exec), thisRef, propertyNameRef, &returnValue ))385 if (getPropertyCallback(toRef(exec), thisRef, propertyNameRef, &returnValue, toRef(exec->exceptionSlot()))) 384 386 return toJS(returnValue); 385 387 } … … 421 423 422 424 if (JSGetPropertyCallback getPropertyCallback = jsClass->callbacks.getProperty) 423 if (getPropertyCallback(toRef(exec), thisRef, propertyNameRef, &returnValue ))425 if (getPropertyCallback(toRef(exec), thisRef, propertyNameRef, &returnValue, toRef(exec->exceptionSlot()))) 424 426 return toJS(returnValue); 425 427 }
Note:
See TracChangeset
for help on using the changeset viewer.