Changeset 37684 in webkit for trunk/JavaScriptCore/kjs/RegExpConstructor.cpp
- Timestamp:
- Oct 18, 2008, 6:52:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/RegExpConstructor.cpp
r37681 r37684 34 34 namespace JSC { 35 35 36 static JSValue *regExpConstructorInput(ExecState*, const Identifier&, const PropertySlot&);37 static JSValue *regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot&);38 static JSValue *regExpConstructorLastMatch(ExecState*, const Identifier&, const PropertySlot&);39 static JSValue *regExpConstructorLastParen(ExecState*, const Identifier&, const PropertySlot&);40 static JSValue *regExpConstructorLeftContext(ExecState*, const Identifier&, const PropertySlot&);41 static JSValue *regExpConstructorRightContext(ExecState*, const Identifier&, const PropertySlot&);42 static JSValue *regExpConstructorDollar1(ExecState*, const Identifier&, const PropertySlot&);43 static JSValue *regExpConstructorDollar2(ExecState*, const Identifier&, const PropertySlot&);44 static JSValue *regExpConstructorDollar3(ExecState*, const Identifier&, const PropertySlot&);45 static JSValue *regExpConstructorDollar4(ExecState*, const Identifier&, const PropertySlot&);46 static JSValue *regExpConstructorDollar5(ExecState*, const Identifier&, const PropertySlot&);47 static JSValue *regExpConstructorDollar6(ExecState*, const Identifier&, const PropertySlot&);48 static JSValue *regExpConstructorDollar7(ExecState*, const Identifier&, const PropertySlot&);49 static JSValue *regExpConstructorDollar8(ExecState*, const Identifier&, const PropertySlot&);50 static JSValue *regExpConstructorDollar9(ExecState*, const Identifier&, const PropertySlot&);51 52 static void setRegExpConstructorInput(ExecState*, JSObject*, JSValue *);53 static void setRegExpConstructorMultiline(ExecState*, JSObject*, JSValue *);36 static JSValuePtr regExpConstructorInput(ExecState*, const Identifier&, const PropertySlot&); 37 static JSValuePtr regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot&); 38 static JSValuePtr regExpConstructorLastMatch(ExecState*, const Identifier&, const PropertySlot&); 39 static JSValuePtr regExpConstructorLastParen(ExecState*, const Identifier&, const PropertySlot&); 40 static JSValuePtr regExpConstructorLeftContext(ExecState*, const Identifier&, const PropertySlot&); 41 static JSValuePtr regExpConstructorRightContext(ExecState*, const Identifier&, const PropertySlot&); 42 static JSValuePtr regExpConstructorDollar1(ExecState*, const Identifier&, const PropertySlot&); 43 static JSValuePtr regExpConstructorDollar2(ExecState*, const Identifier&, const PropertySlot&); 44 static JSValuePtr regExpConstructorDollar3(ExecState*, const Identifier&, const PropertySlot&); 45 static JSValuePtr regExpConstructorDollar4(ExecState*, const Identifier&, const PropertySlot&); 46 static JSValuePtr regExpConstructorDollar5(ExecState*, const Identifier&, const PropertySlot&); 47 static JSValuePtr regExpConstructorDollar6(ExecState*, const Identifier&, const PropertySlot&); 48 static JSValuePtr regExpConstructorDollar7(ExecState*, const Identifier&, const PropertySlot&); 49 static JSValuePtr regExpConstructorDollar8(ExecState*, const Identifier&, const PropertySlot&); 50 static JSValuePtr regExpConstructorDollar9(ExecState*, const Identifier&, const PropertySlot&); 51 52 static void setRegExpConstructorInput(ExecState*, JSObject*, JSValuePtr); 53 static void setRegExpConstructorMultiline(ExecState*, JSObject*, JSValuePtr); 54 54 55 55 } // namespace JSC … … 186 186 } 187 187 188 JSValue *RegExpConstructor::getBackref(ExecState* exec, unsigned i) const188 JSValuePtr RegExpConstructor::getBackref(ExecState* exec, unsigned i) const 189 189 { 190 190 if (d->lastOvector && i <= d->lastNumSubPatterns) { … … 196 196 } 197 197 198 JSValue *RegExpConstructor::getLastParen(ExecState* exec) const198 JSValuePtr RegExpConstructor::getLastParen(ExecState* exec) const 199 199 { 200 200 unsigned i = d->lastNumSubPatterns; … … 208 208 } 209 209 210 JSValue *RegExpConstructor::getLeftContext(ExecState* exec) const210 JSValuePtr RegExpConstructor::getLeftContext(ExecState* exec) const 211 211 { 212 212 if (d->lastOvector) … … 215 215 } 216 216 217 JSValue *RegExpConstructor::getRightContext(ExecState* exec) const217 JSValuePtr RegExpConstructor::getRightContext(ExecState* exec) const 218 218 { 219 219 if (d->lastOvector) … … 227 227 } 228 228 229 JSValue *regExpConstructorDollar1(ExecState* exec, const Identifier&, const PropertySlot& slot)229 JSValuePtr regExpConstructorDollar1(ExecState* exec, const Identifier&, const PropertySlot& slot) 230 230 { 231 231 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 1); 232 232 } 233 233 234 JSValue *regExpConstructorDollar2(ExecState* exec, const Identifier&, const PropertySlot& slot)234 JSValuePtr regExpConstructorDollar2(ExecState* exec, const Identifier&, const PropertySlot& slot) 235 235 { 236 236 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 2); 237 237 } 238 238 239 JSValue *regExpConstructorDollar3(ExecState* exec, const Identifier&, const PropertySlot& slot)239 JSValuePtr regExpConstructorDollar3(ExecState* exec, const Identifier&, const PropertySlot& slot) 240 240 { 241 241 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 3); 242 242 } 243 243 244 JSValue *regExpConstructorDollar4(ExecState* exec, const Identifier&, const PropertySlot& slot)244 JSValuePtr regExpConstructorDollar4(ExecState* exec, const Identifier&, const PropertySlot& slot) 245 245 { 246 246 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 4); 247 247 } 248 248 249 JSValue *regExpConstructorDollar5(ExecState* exec, const Identifier&, const PropertySlot& slot)249 JSValuePtr regExpConstructorDollar5(ExecState* exec, const Identifier&, const PropertySlot& slot) 250 250 { 251 251 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 5); 252 252 } 253 253 254 JSValue *regExpConstructorDollar6(ExecState* exec, const Identifier&, const PropertySlot& slot)254 JSValuePtr regExpConstructorDollar6(ExecState* exec, const Identifier&, const PropertySlot& slot) 255 255 { 256 256 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 6); 257 257 } 258 258 259 JSValue *regExpConstructorDollar7(ExecState* exec, const Identifier&, const PropertySlot& slot)259 JSValuePtr regExpConstructorDollar7(ExecState* exec, const Identifier&, const PropertySlot& slot) 260 260 { 261 261 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 7); 262 262 } 263 263 264 JSValue *regExpConstructorDollar8(ExecState* exec, const Identifier&, const PropertySlot& slot)264 JSValuePtr regExpConstructorDollar8(ExecState* exec, const Identifier&, const PropertySlot& slot) 265 265 { 266 266 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 8); 267 267 } 268 268 269 JSValue *regExpConstructorDollar9(ExecState* exec, const Identifier&, const PropertySlot& slot)269 JSValuePtr regExpConstructorDollar9(ExecState* exec, const Identifier&, const PropertySlot& slot) 270 270 { 271 271 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 9); 272 272 } 273 273 274 JSValue *regExpConstructorInput(ExecState* exec, const Identifier&, const PropertySlot& slot)274 JSValuePtr regExpConstructorInput(ExecState* exec, const Identifier&, const PropertySlot& slot) 275 275 { 276 276 return jsString(exec, asRegExpConstructor(slot.slotBase())->input()); 277 277 } 278 278 279 JSValue *regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot& slot)279 JSValuePtr regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot& slot) 280 280 { 281 281 return jsBoolean(asRegExpConstructor(slot.slotBase())->multiline()); 282 282 } 283 283 284 JSValue *regExpConstructorLastMatch(ExecState* exec, const Identifier&, const PropertySlot& slot)284 JSValuePtr regExpConstructorLastMatch(ExecState* exec, const Identifier&, const PropertySlot& slot) 285 285 { 286 286 return asRegExpConstructor(slot.slotBase())->getBackref(exec, 0); 287 287 } 288 288 289 JSValue *regExpConstructorLastParen(ExecState* exec, const Identifier&, const PropertySlot& slot)289 JSValuePtr regExpConstructorLastParen(ExecState* exec, const Identifier&, const PropertySlot& slot) 290 290 { 291 291 return asRegExpConstructor(slot.slotBase())->getLastParen(exec); 292 292 } 293 293 294 JSValue *regExpConstructorLeftContext(ExecState* exec, const Identifier&, const PropertySlot& slot)294 JSValuePtr regExpConstructorLeftContext(ExecState* exec, const Identifier&, const PropertySlot& slot) 295 295 { 296 296 return asRegExpConstructor(slot.slotBase())->getLeftContext(exec); 297 297 } 298 298 299 JSValue *regExpConstructorRightContext(ExecState* exec, const Identifier&, const PropertySlot& slot)299 JSValuePtr regExpConstructorRightContext(ExecState* exec, const Identifier&, const PropertySlot& slot) 300 300 { 301 301 return asRegExpConstructor(slot.slotBase())->getRightContext(exec); 302 302 } 303 303 304 void RegExpConstructor::put(ExecState* exec, const Identifier& propertyName, JSValue *value, PutPropertySlot& slot)304 void RegExpConstructor::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot) 305 305 { 306 306 lookupPut<RegExpConstructor, InternalFunction>(exec, propertyName, value, ExecState::regExpConstructorTable(exec), this, slot); 307 307 } 308 308 309 void setRegExpConstructorInput(ExecState* exec, JSObject* baseObject, JSValue *value)309 void setRegExpConstructorInput(ExecState* exec, JSObject* baseObject, JSValuePtr value) 310 310 { 311 311 asRegExpConstructor(baseObject)->setInput(value->toString(exec)); 312 312 } 313 313 314 void setRegExpConstructorMultiline(ExecState* exec, JSObject* baseObject, JSValue *value)314 void setRegExpConstructorMultiline(ExecState* exec, JSObject* baseObject, JSValuePtr value) 315 315 { 316 316 asRegExpConstructor(baseObject)->setMultiline(value->toBoolean(exec)); … … 320 320 JSObject* constructRegExp(ExecState* exec, const ArgList& args) 321 321 { 322 JSValue *arg0 = args.at(exec, 0);323 JSValue *arg1 = args.at(exec, 1);322 JSValuePtr arg0 = args.at(exec, 0); 323 JSValuePtr arg1 = args.at(exec, 1); 324 324 325 325 if (arg0->isObject(&RegExpObject::info)) { … … 350 350 351 351 // ECMA 15.10.3 352 static JSValue * callRegExpConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)352 static JSValuePtr callRegExpConstructor(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 353 353 { 354 354 return constructRegExp(exec, args);
Note:
See TracChangeset
for help on using the changeset viewer.