Skip to content
  • barraclough@apple.com's avatar
    Bug 56041 - RexExp constructor should only accept flags "gim" · 1281293b
    barraclough@apple.com authored
    We also should be passing the flags around as a bitfield rather than a string,
    and should not have redundant, incompatible code for converting the string to a bitfield!
    
    Reviewed by Darin Adler.
    
    Source/JavaScriptCore: 
    
    * JavaScriptCore.exp:
    * bytecompiler/NodesCodegen.cpp:
    (JSC::RegExpNode::emitBytecode):
        - Need to parse flags string to enum.
    * runtime/RegExp.cpp:
    (JSC::regExpFlags):
    (JSC::RegExp::RegExp):
    (JSC::RegExp::create):
        - Add method to parse flags string to enum, change constructor/create args to take enum.
    * runtime/RegExp.h:
    (JSC::RegExp::global):
    (JSC::RegExp::ignoreCase):
    (JSC::RegExp::multiline):
        - Change to use new enum values.
    * runtime/RegExpCache.cpp:
    (JSC::RegExpCache::lookupOrCreate):
    (JSC::RegExpCache::create):
    * runtime/RegExpCache.h:
        - Changed to use regExpFlags enum instead of int/const UString&.
    * runtime/RegExpConstructor.cpp:
    (JSC::constructRegExp):
        - Add use new enum parsing, check for error.
    * runtime/RegExpKey.h:
    (JSC::RegExpKey::RegExpKey):
    * runtime/RegExpPrototype.cpp:
    (JSC::RegExpPrototype::RegExpPrototype):
        - Pass NoFlags value instead of empty string.
    (JSC::regExpProtoFuncCompile):
        - Add use new enum parsing, check for error.
    * runtime/StringPrototype.cpp:
    (JSC::stringProtoFuncMatch):
    (JSC::stringProtoFuncSearch):
        - Pass NoFlags value instead of empty string.
    
    Source/WebCore: 
    
    * bindings/js/SerializedScriptValue.cpp:
    (WebCore::CloneDeserializer::readTerminal):
        - Need to parse flags string back to enum.
    
    LayoutTests: 
    
    * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A5_T1-expected.txt:
    * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A5_T2-expected.txt:
    * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A5_T3-expected.txt:
    * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A5_T4-expected.txt:
    * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A5_T5-expected.txt:
    * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A5_T6-expected.txt:
    * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A5_T7-expected.txt:
    * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A5_T8-expected.txt:
    * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A5_T9-expected.txt:
        - Check in passing results!
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    1281293b