Changeset 161033 in webkit for trunk/Source/JavaScriptCore/runtime/Lookup.h
- Timestamp:
- Dec 23, 2013, 4:11:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Lookup.h
r161009 r161033 27 27 #include "JSGlobalObject.h" 28 28 #include "PropertySlot.h" 29 #include "PutPropertySlot.h" 29 30 #include <wtf/Assertions.h> 30 31 … … 42 43 // ie. typedef JSValue (*GetFunction)(ExecState*, JSObject* baseObject) 43 44 typedef PropertySlot::GetValueFunc GetFunction; 44 typedef void (*PutFunction)(ExecState*, EncodedJSValue base, EncodedJSValue value);45 typedef PutPropertySlot::PutValueFunc PutFunction; 45 46 46 47 class HashEntry { … … 291 292 } 292 293 293 template <class ThisImp> 294 inline void putEntry(ExecState* exec, const HashEntry* entry, PropertyName propertyName, JSValue value, ThisImp* thisObj, bool shouldThrow = false) 294 inline void putEntry(ExecState* exec, const HashEntry* entry, PropertyName propertyName, JSValue value, PutPropertySlot& slot) 295 295 { 296 296 // If this is a function put it as an override property. 297 297 if (entry->attributes() & Function) 298 thisObj->putDirect(exec->vm(), propertyName, value); 299 else if (!(entry->attributes() & ReadOnly)) 300 entry->propertyPutter()(exec, JSValue::encode(thisObj), JSValue::encode(value)); 301 else if (shouldThrow) 298 slot.base()->putDirect(exec->vm(), propertyName, value); 299 else if (!(entry->attributes() & ReadOnly)) { 300 entry->propertyPutter()(exec, JSValue::encode(slot.thisValue()), JSValue::encode(value)); 301 slot.setCustomProperty(slot.base(), entry->propertyPutter()); 302 } else if (slot.isStrictMode()) 302 303 throwTypeError(exec, StrictModeReadonlyPropertyWriteError); 303 304 } … … 308 309 * is found it sets the value and returns true, else it returns false. 309 310 */ 310 template <class ThisImp> 311 inline bool lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, ThisImp* thisObj, bool shouldThrow = false) 311 inline bool lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, PutPropertySlot& slot) 312 312 { 313 313 const HashEntry* entry = table.entry(exec, propertyName); … … 316 316 return false; 317 317 318 putEntry <ThisImp>(exec, entry, propertyName, value, thisObj, shouldThrow);318 putEntry(exec, entry, propertyName, value, slot); 319 319 return true; 320 320 } … … 329 329 inline void lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, ThisImp* thisObj, PutPropertySlot& slot) 330 330 { 331 if (!lookupPut <ThisImp>(exec, propertyName, value, table, thisObj, slot.isStrictMode()))331 if (!lookupPut(exec, propertyName, value, table, slot)) 332 332 ParentImp::put(thisObj, exec, propertyName, value, slot); // not found: forward to parent 333 333 }
Note:
See TracChangeset
for help on using the changeset viewer.