Changeset 15473 in webkit for trunk/JavaScriptCore/API/JSCallbackObject.cpp
- Timestamp:
- Jul 16, 2006, 6:48:27 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackObject.cpp
r15469 r15473 108 108 109 109 if (__JSClass::StaticValuesTable* staticValues = jsClass->staticValues) { 110 if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) { 111 if (entry->getProperty) { 112 slot.setCustom(this, staticValueGetter); 113 return true; 114 } 110 if (staticValues->contains(propertyName.ustring().rep())) { 111 slot.setCustom(this, staticValueGetter); 112 return true; 115 113 } 116 114 } … … 149 147 if (entry->attributes & kJSPropertyAttributeReadOnly) 150 148 return; 151 if (JSObjectSetPropertyCallback setProperty = entry->setProperty) {152 if (setProperty(context, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot())))153 return;154 }149 if (JSObjectSetPropertyCallback setProperty = entry->setProperty) 150 setProperty(context, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot())); 151 else 152 throwError(exec, ReferenceError, "Writable static value property defined with NULL setProperty callback."); 155 153 } 156 154 } … … 393 391 return toJS(value); 394 392 395 return jsUndefined();393 return throwError(exec, ReferenceError, "Static value property defined with NULL getProperty callback."); 396 394 } 397 395 … … 407 405 if (__JSClass::StaticFunctionsTable* staticFunctions = jsClass->staticFunctions) { 408 406 if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) { 409 JSObject* o = new JSCallbackFunction(exec, entry->callAsFunction, propertyName); 410 thisObj->putDirect(propertyName, o, entry->attributes); 411 return o; 412 } 413 } 414 } 415 416 return jsUndefined(); 407 if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) { 408 JSObject* o = new JSCallbackFunction(exec, callAsFunction, propertyName); 409 thisObj->putDirect(propertyName, o, entry->attributes); 410 return o; 411 } 412 } 413 } 414 } 415 416 return throwError(exec, ReferenceError, "Static function property defined with NULL callAsFunction callback."); 417 417 } 418 418 … … 430 430 return toJS(value); 431 431 432 return jsUndefined();432 return throwError(exec, ReferenceError, "hasProperty callback returned true for a property that doesn't exist."); 433 433 } 434 434
Note:
See TracChangeset
for help on using the changeset viewer.