Changeset 37845 in webkit for trunk/JavaScriptCore/kjs/RegExpConstructor.cpp
- Timestamp:
- Oct 24, 2008, 9:22:51 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/RegExpConstructor.cpp
r37747 r37845 34 34 namespace JSC { 35 35 36 static JSValue PtrregExpConstructorInput(ExecState*, const Identifier&, const PropertySlot&);37 static JSValue PtrregExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot&);38 static JSValue PtrregExpConstructorLastMatch(ExecState*, const Identifier&, const PropertySlot&);39 static JSValue PtrregExpConstructorLastParen(ExecState*, const Identifier&, const PropertySlot&);40 static JSValue PtrregExpConstructorLeftContext(ExecState*, const Identifier&, const PropertySlot&);41 static JSValue PtrregExpConstructorRightContext(ExecState*, const Identifier&, const PropertySlot&);42 static JSValue PtrregExpConstructorDollar1(ExecState*, const Identifier&, const PropertySlot&);43 static JSValue PtrregExpConstructorDollar2(ExecState*, const Identifier&, const PropertySlot&);44 static JSValue PtrregExpConstructorDollar3(ExecState*, const Identifier&, const PropertySlot&);45 static JSValue PtrregExpConstructorDollar4(ExecState*, const Identifier&, const PropertySlot&);46 static JSValue PtrregExpConstructorDollar5(ExecState*, const Identifier&, const PropertySlot&);47 static JSValue PtrregExpConstructorDollar6(ExecState*, const Identifier&, const PropertySlot&);48 static JSValue PtrregExpConstructorDollar7(ExecState*, const Identifier&, const PropertySlot&);49 static JSValue PtrregExpConstructorDollar8(ExecState*, const Identifier&, const PropertySlot&);50 static JSValue PtrregExpConstructorDollar9(ExecState*, const Identifier&, const PropertySlot&);51 52 static void setRegExpConstructorInput(ExecState*, JSObject*, JSValue Ptr);53 static void setRegExpConstructorMultiline(ExecState*, JSObject*, JSValue Ptr);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*); 54 54 55 55 } // namespace JSC … … 186 186 } 187 187 188 JSValue PtrRegExpConstructor::getBackref(ExecState* exec, unsigned i) const188 JSValue* RegExpConstructor::getBackref(ExecState* exec, unsigned i) const 189 189 { 190 190 if (d->lastOvector && i <= d->lastNumSubPatterns) { … … 196 196 } 197 197 198 JSValue PtrRegExpConstructor::getLastParen(ExecState* exec) const198 JSValue* RegExpConstructor::getLastParen(ExecState* exec) const 199 199 { 200 200 unsigned i = d->lastNumSubPatterns; … … 208 208 } 209 209 210 JSValue PtrRegExpConstructor::getLeftContext(ExecState* exec) const210 JSValue* RegExpConstructor::getLeftContext(ExecState* exec) const 211 211 { 212 212 if (d->lastOvector) … … 215 215 } 216 216 217 JSValue PtrRegExpConstructor::getRightContext(ExecState* exec) const217 JSValue* RegExpConstructor::getRightContext(ExecState* exec) const 218 218 { 219 219 if (d->lastOvector) … … 227 227 } 228 228 229 JSValue PtrregExpConstructorDollar1(ExecState* exec, const Identifier&, const PropertySlot& slot)229 JSValue* 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 PtrregExpConstructorDollar2(ExecState* exec, const Identifier&, const PropertySlot& slot)234 JSValue* 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 PtrregExpConstructorDollar3(ExecState* exec, const Identifier&, const PropertySlot& slot)239 JSValue* 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 PtrregExpConstructorDollar4(ExecState* exec, const Identifier&, const PropertySlot& slot)244 JSValue* 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 PtrregExpConstructorDollar5(ExecState* exec, const Identifier&, const PropertySlot& slot)249 JSValue* 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 PtrregExpConstructorDollar6(ExecState* exec, const Identifier&, const PropertySlot& slot)254 JSValue* 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 PtrregExpConstructorDollar7(ExecState* exec, const Identifier&, const PropertySlot& slot)259 JSValue* 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 PtrregExpConstructorDollar8(ExecState* exec, const Identifier&, const PropertySlot& slot)264 JSValue* 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 PtrregExpConstructorDollar9(ExecState* exec, const Identifier&, const PropertySlot& slot)269 JSValue* 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 PtrregExpConstructorInput(ExecState* exec, const Identifier&, const PropertySlot& slot)274 JSValue* 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 PtrregExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot& slot)279 JSValue* regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot& slot) 280 280 { 281 281 return jsBoolean(asRegExpConstructor(slot.slotBase())->multiline()); 282 282 } 283 283 284 JSValue PtrregExpConstructorLastMatch(ExecState* exec, const Identifier&, const PropertySlot& slot)284 JSValue* 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 PtrregExpConstructorLastParen(ExecState* exec, const Identifier&, const PropertySlot& slot)289 JSValue* regExpConstructorLastParen(ExecState* exec, const Identifier&, const PropertySlot& slot) 290 290 { 291 291 return asRegExpConstructor(slot.slotBase())->getLastParen(exec); 292 292 } 293 293 294 JSValue PtrregExpConstructorLeftContext(ExecState* exec, const Identifier&, const PropertySlot& slot)294 JSValue* regExpConstructorLeftContext(ExecState* exec, const Identifier&, const PropertySlot& slot) 295 295 { 296 296 return asRegExpConstructor(slot.slotBase())->getLeftContext(exec); 297 297 } 298 298 299 JSValue PtrregExpConstructorRightContext(ExecState* exec, const Identifier&, const PropertySlot& slot)299 JSValue* 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 Ptrvalue, PutPropertySlot& slot)304 void RegExpConstructor::put(ExecState* exec, const Identifier& propertyName, JSValue* 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 Ptrvalue)309 void setRegExpConstructorInput(ExecState* exec, JSObject* baseObject, JSValue* value) 310 310 { 311 311 asRegExpConstructor(baseObject)->setInput(value->toString(exec)); 312 312 } 313 313 314 void setRegExpConstructorMultiline(ExecState* exec, JSObject* baseObject, JSValue Ptrvalue)314 void setRegExpConstructorMultiline(ExecState* exec, JSObject* baseObject, JSValue* value) 315 315 { 316 316 asRegExpConstructor(baseObject)->setMultiline(value->toBoolean(exec)); … … 320 320 JSObject* constructRegExp(ExecState* exec, const ArgList& args) 321 321 { 322 JSValue Ptrarg0 = args.at(exec, 0);323 JSValue Ptrarg1 = args.at(exec, 1);322 JSValue* arg0 = args.at(exec, 0); 323 JSValue* 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 Ptr callRegExpConstructor(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)352 static JSValue* callRegExpConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args) 353 353 { 354 354 return constructRegExp(exec, args);
Note:
See TracChangeset
for help on using the changeset viewer.