Changeset 38975 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Dec 3, 2008, 4:10:53 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/RegExp.cpp
r38839 r38975 38 38 #endif 39 39 40 inline RegExp::RegExp( JSGlobalData* globalData,const UString& pattern)40 inline RegExp::RegExp(const UString& pattern) 41 41 : m_pattern(pattern) 42 42 , m_flagBits(0) … … 46 46 { 47 47 #if ENABLE(WREC) 48 m_wrecFunction = Generator::compileRegExp( globalData->interpreter,pattern, &m_numSubpatterns, &m_constructionError);48 m_wrecFunction = Generator::compileRegExp(pattern, &m_numSubpatterns, &m_constructionError); 49 49 if (m_wrecFunction) 50 50 return; 51 51 // Fall through to non-WREC case. 52 #else53 UNUSED_PARAM(globalData);54 52 #endif 55 53 m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(), … … 57 55 } 58 56 59 PassRefPtr<RegExp> RegExp::create( JSGlobalData* globalData,const UString& pattern)57 PassRefPtr<RegExp> RegExp::create(const UString& pattern) 60 58 { 61 return adoptRef(new RegExp( globalData,pattern));59 return adoptRef(new RegExp(pattern)); 62 60 } 63 61 64 inline RegExp::RegExp( JSGlobalData* globalData,const UString& pattern, const UString& flags)62 inline RegExp::RegExp(const UString& pattern, const UString& flags) 65 63 : m_pattern(pattern) 66 64 , m_flags(flags) … … 89 87 90 88 #if ENABLE(WREC) 91 m_wrecFunction = Generator::compileRegExp( globalData->interpreter,pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline));89 m_wrecFunction = Generator::compileRegExp(pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline)); 92 90 if (m_wrecFunction) 93 91 return; 94 92 // Fall through to non-WREC case. 95 #else96 UNUSED_PARAM(globalData);97 93 #endif 98 94 m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(), … … 100 96 } 101 97 102 PassRefPtr<RegExp> RegExp::create( JSGlobalData* globalData,const UString& pattern, const UString& flags)98 PassRefPtr<RegExp> RegExp::create(const UString& pattern, const UString& flags) 103 99 { 104 return adoptRef(new RegExp( globalData,pattern, flags));100 return adoptRef(new RegExp(pattern, flags)); 105 101 } 106 102 -
trunk/JavaScriptCore/runtime/RegExp.h
r38603 r38975 35 35 class RegExp : public RefCounted<RegExp> { 36 36 public: 37 static PassRefPtr<RegExp> create( JSGlobalData*,const UString& pattern);38 static PassRefPtr<RegExp> create( JSGlobalData*,const UString& pattern, const UString& flags);37 static PassRefPtr<RegExp> create(const UString& pattern); 38 static PassRefPtr<RegExp> create(const UString& pattern, const UString& flags); 39 39 ~RegExp(); 40 40 … … 53 53 54 54 private: 55 RegExp( JSGlobalData*,const UString& pattern);56 RegExp( JSGlobalData*,const UString& pattern, const UString& flags);55 RegExp(const UString& pattern); 56 RegExp(const UString& pattern, const UString& flags); 57 57 58 58 void compile(); -
trunk/JavaScriptCore/runtime/RegExpConstructor.cpp
r38440 r38975 332 332 UString flags = arg1->isUndefined() ? UString("") : arg1->toString(exec); 333 333 334 RefPtr<RegExp> regExp = RegExp::create( &exec->globalData(),pattern, flags);334 RefPtr<RegExp> regExp = RegExp::create(pattern, flags); 335 335 if (!regExp->isValid()) 336 336 return throwError(exec, SyntaxError, UString("Invalid regular expression: ").append(regExp->errorMessage())); -
trunk/JavaScriptCore/runtime/RegExpPrototype.cpp
r38440 r38975 86 86 UString pattern = args.isEmpty() ? UString("") : arg0->toString(exec); 87 87 UString flags = arg1->isUndefined() ? UString("") : arg1->toString(exec); 88 regExp = RegExp::create( &exec->globalData(),pattern, flags);88 regExp = RegExp::create(pattern, flags); 89 89 } 90 90 -
trunk/JavaScriptCore/runtime/StringPrototype.cpp
r38603 r38975 413 413 * replaced with the result of the expression new RegExp(regexp). 414 414 */ 415 reg = RegExp::create( &exec->globalData(),a0->toString(exec));415 reg = RegExp::create(a0->toString(exec)); 416 416 } 417 417 RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor(); … … 463 463 * replaced with the result of the expression new RegExp(regexp). 464 464 */ 465 reg = RegExp::create( &exec->globalData(),a0->toString(exec));465 reg = RegExp::create(a0->toString(exec)); 466 466 } 467 467 RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
Note:
See TracChangeset
for help on using the changeset viewer.