Changeset 36977 in webkit for trunk/JavaScriptCore/kjs/RegExpObject.cpp
- Timestamp:
- Sep 26, 2008, 7:36:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/RegExpObject.cpp
r36726 r36977 21 21 #include "config.h" 22 22 #include "RegExpObject.h" 23 #include "RegExpObject.lut.h"24 23 25 24 #include "JSArray.h" … … 31 30 namespace JSC { 32 31 32 static JSValue* regExpObjectGlobal(ExecState*, const Identifier&, const PropertySlot&); 33 static JSValue* regExpObjectIgnoreCase(ExecState*, const Identifier&, const PropertySlot&); 34 static JSValue* regExpObjectMultiline(ExecState*, const Identifier&, const PropertySlot&); 35 static JSValue* regExpObjectSource(ExecState*, const Identifier&, const PropertySlot&); 36 static JSValue* regExpObjectLastIndex(ExecState*, const Identifier&, const PropertySlot&); 37 static void setRegExpObjectLastIndex(ExecState*, JSObject*, JSValue*); 38 39 } // namespace JSC 40 41 #include "RegExpObject.lut.h" 42 43 namespace JSC { 44 33 45 ASSERT_CLASS_FITS_IN_CELL(RegExpObject); 34 46 … … 37 49 /* Source for RegExpObject.lut.h 38 50 @begin regExpTable 39 global RegExpObject::Global DontDelete|ReadOnly|DontEnum40 ignoreCase RegExpObject::IgnoreCase DontDelete|ReadOnly|DontEnum41 multiline RegExpObject::Multiline DontDelete|ReadOnly|DontEnum42 source RegExpObject::Source DontDelete|ReadOnly|DontEnum43 lastIndex RegExpObject::LastIndex DontDelete|DontEnum51 global regExpObjectGlobal DontDelete|ReadOnly|DontEnum 52 ignoreCase regExpObjectIgnoreCase DontDelete|ReadOnly|DontEnum 53 multiline regExpObjectMultiline DontDelete|ReadOnly|DontEnum 54 source regExpObjectSource DontDelete|ReadOnly|DontEnum 55 lastIndex regExpObjectLastIndex DontDelete|DontEnum 44 56 @end 45 57 */ … … 60 72 } 61 73 62 JSValue* RegExpObject::getValueProperty(ExecState* exec, int token) const74 JSValue* regExpObjectGlobal(ExecState*, const Identifier&, const PropertySlot& slot) 63 75 { 64 switch (token) { 65 case Global: 66 return jsBoolean(d->regExp->global()); 67 case IgnoreCase: 68 return jsBoolean(d->regExp->ignoreCase()); 69 case Multiline: 70 return jsBoolean(d->regExp->multiline()); 71 case Source: 72 return jsString(exec, d->regExp->pattern()); 73 case LastIndex: 74 return jsNumber(exec, d->lastIndex); 75 } 76 77 ASSERT_NOT_REACHED(); 78 return 0; 76 return jsBoolean(static_cast<RegExpObject*>(slot.slotBase())->regExp()->global()); 77 } 78 79 JSValue* regExpObjectIgnoreCase(ExecState*, const Identifier&, const PropertySlot& slot) 80 { 81 return jsBoolean(static_cast<RegExpObject*>(slot.slotBase())->regExp()->ignoreCase()); 82 } 83 84 JSValue* regExpObjectMultiline(ExecState*, const Identifier&, const PropertySlot& slot) 85 { 86 return jsBoolean(static_cast<RegExpObject*>(slot.slotBase())->regExp()->multiline()); 87 } 88 89 JSValue* regExpObjectSource(ExecState* exec, const Identifier&, const PropertySlot& slot) 90 { 91 return jsString(exec, static_cast<RegExpObject*>(slot.slotBase())->regExp()->pattern()); 92 } 93 94 JSValue* regExpObjectLastIndex(ExecState* exec, const Identifier&, const PropertySlot& slot) 95 { 96 return jsNumber(exec, static_cast<RegExpObject*>(slot.slotBase())->lastIndex()); 79 97 } 80 98 … … 84 102 } 85 103 86 void RegExpObject::putValueProperty(ExecState* exec, int token, JSValue* value)104 void setRegExpObjectLastIndex(ExecState* exec, JSObject* baseObject, JSValue* value) 87 105 { 88 UNUSED_PARAM(token); 89 ASSERT(token == LastIndex); 90 d->lastIndex = value->toInteger(exec); 106 static_cast<RegExpObject*>(baseObject)->setLastIndex(value->toInteger(exec)); 91 107 } 92 108
Note:
See TracChangeset
for help on using the changeset viewer.