Changeset 34578 in webkit for trunk/JavaScriptCore/kjs/regexp_object.cpp
- Timestamp:
- Jun 15, 2008, 7:19:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/regexp_object.cpp
r34119 r34578 315 315 } 316 316 317 class RegExpMatchesArray : public ArrayInstance{317 class RegExpMatchesArray : public JSArray { 318 318 public: 319 319 RegExpMatchesArray(ExecState*, RegExpObjectImpPrivate*); … … 321 321 virtual ~RegExpMatchesArray(); 322 322 323 virtual bool getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { if (lazyCreationData()) fillArrayInstance(exec); return ArrayInstance::getOwnPropertySlot(exec, propertyName, slot); }324 virtual bool getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) { if (lazyCreationData()) fillArrayInstance(exec); return ArrayInstance::getOwnPropertySlot(exec, propertyName, slot); }325 virtual void put(ExecState* exec, const Identifier& propertyName, JSValue* v) { if (lazyCreationData()) fillArrayInstance(exec); ArrayInstance::put(exec, propertyName, v); }326 virtual void put(ExecState* exec, unsigned propertyName, JSValue* v) { if (lazyCreationData()) fillArrayInstance(exec); ArrayInstance::put(exec, propertyName, v); }327 virtual bool deleteProperty(ExecState* exec, const Identifier& propertyName) { if (lazyCreationData()) fillArrayInstance(exec); return ArrayInstance::deleteProperty(exec, propertyName); }328 virtual bool deleteProperty(ExecState* exec, unsigned propertyName) { if (lazyCreationData()) fillArrayInstance(exec); return ArrayInstance::deleteProperty(exec, propertyName); }329 virtual void getPropertyNames(ExecState* exec, PropertyNameArray& arr) { if (lazyCreationData()) fillArrayInstance(exec); ArrayInstance::getPropertyNames(exec, arr); }323 virtual bool getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { if (lazyCreationData()) fillArrayInstance(exec); return JSArray::getOwnPropertySlot(exec, propertyName, slot); } 324 virtual bool getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) { if (lazyCreationData()) fillArrayInstance(exec); return JSArray::getOwnPropertySlot(exec, propertyName, slot); } 325 virtual void put(ExecState* exec, const Identifier& propertyName, JSValue* v) { if (lazyCreationData()) fillArrayInstance(exec); JSArray::put(exec, propertyName, v); } 326 virtual void put(ExecState* exec, unsigned propertyName, JSValue* v) { if (lazyCreationData()) fillArrayInstance(exec); JSArray::put(exec, propertyName, v); } 327 virtual bool deleteProperty(ExecState* exec, const Identifier& propertyName) { if (lazyCreationData()) fillArrayInstance(exec); return JSArray::deleteProperty(exec, propertyName); } 328 virtual bool deleteProperty(ExecState* exec, unsigned propertyName) { if (lazyCreationData()) fillArrayInstance(exec); return JSArray::deleteProperty(exec, propertyName); } 329 virtual void getPropertyNames(ExecState* exec, PropertyNameArray& arr) { if (lazyCreationData()) fillArrayInstance(exec); JSArray::getPropertyNames(exec, arr); } 330 330 331 331 private: … … 334 334 335 335 RegExpMatchesArray::RegExpMatchesArray(ExecState* exec, RegExpObjectImpPrivate* data) 336 : ArrayInstance(exec->lexicalGlobalObject()->arrayPrototype(), data->lastNumSubPatterns + 1)336 : JSArray(exec->lexicalGlobalObject()->arrayPrototype(), data->lastNumSubPatterns + 1) 337 337 { 338 338 RegExpObjectImpPrivate* d = new RegExpObjectImpPrivate; … … 362 362 int start = d->lastOvector[2 * i]; 363 363 if (start >= 0) 364 ArrayInstance::put(exec, i, jsString(d->lastInput.substr(start, d->lastOvector[2 * i + 1] - start)));365 } 366 ArrayInstance::put(exec, exec->propertyNames().index, jsNumber(d->lastOvector[0]));367 ArrayInstance::put(exec, exec->propertyNames().input, jsString(d->lastInput));364 JSArray::put(exec, i, jsString(d->lastInput.substr(start, d->lastOvector[2 * i + 1] - start))); 365 } 366 JSArray::put(exec, exec->propertyNames().index, jsNumber(d->lastOvector[0])); 367 JSArray::put(exec, exec->propertyNames().input, jsString(d->lastInput)); 368 368 369 369 delete d;
Note:
See TracChangeset
for help on using the changeset viewer.