Changeset 109008 in webkit for trunk/Source/JavaScriptCore/runtime/RegExpObject.h
- Timestamp:
- Feb 27, 2012, 10:29:04 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/RegExpObject.h
r104900 r109008 48 48 RegExp* regExp() const { return d->regExp.get(); } 49 49 50 void setLastIndex( size_t lastIndex)50 void setLastIndex(ExecState* exec, size_t lastIndex) 51 51 { 52 52 d->lastIndex.setWithoutWriteBarrier(jsNumber(lastIndex)); 53 if (LIKELY(d->lastIndexIsWritable)) 54 d->lastIndex.setWithoutWriteBarrier(jsNumber(lastIndex)); 55 else 56 throwTypeError(exec, StrictModeReadonlyPropertyWriteError); 53 57 } 54 void setLastIndex( JSGlobalData& globalData, JSValue lastIndex)58 void setLastIndex(ExecState* exec, JSValue lastIndex, bool shouldThrow) 55 59 { 56 d->lastIndex.set(globalData, this, lastIndex); 60 if (LIKELY(d->lastIndexIsWritable)) 61 d->lastIndex.set(exec->globalData(), this, lastIndex); 62 else if (shouldThrow) 63 throwTypeError(exec, StrictModeReadonlyPropertyWriteError); 57 64 } 58 65 JSValue getLastIndex() const … … 84 91 static void visitChildren(JSCell*, SlotVisitor&); 85 92 93 JS_EXPORT_PRIVATE static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName); 94 JS_EXPORT_PRIVATE static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 95 JS_EXPORT_PRIVATE static void getPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 96 JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, const Identifier& propertyName, PropertyDescriptor&, bool shouldThrow); 97 86 98 private: 87 99 bool match(ExecState*); … … 92 104 RegExpObjectData(JSGlobalData& globalData, RegExpObject* owner, RegExp* regExp) 93 105 : regExp(globalData, owner, regExp) 106 , lastIndexIsWritable(true) 94 107 { 95 108 lastIndex.setWithoutWriteBarrier(jsNumber(0)); … … 98 111 WriteBarrier<RegExp> regExp; 99 112 WriteBarrier<Unknown> lastIndex; 113 bool lastIndexIsWritable; 100 114 }; 101 115 #if COMPILER(MSVC)
Note:
See TracChangeset
for help on using the changeset viewer.