Changeset 17862 in webkit for trunk/JavaScriptCore/kjs/regexp.h


Ignore:
Timestamp:
Nov 20, 2006, 12:24:22 PM (19 years ago)
Author:
ap
Message:

2006-11-20 W. Andy Carrel <[email protected]>

Reviewed by Maciej.

http://bugs.webkit.org/show_bug.cgi?id=11501
REGRESSION: \u no longer escapes metacharacters in RegExps
http://bugs.webkit.org/show_bug.cgi?id=11502
Serializing RegExps doesn't preserve Unicode escapes

JavaScriptCore:

  • kjs/lexer.cpp: (Lexer::Lexer): (Lexer::setCode): (Lexer::shift): (Lexer::scanRegExp): Push \u parsing back down into the RegExp object rather than in the parser. This backs out r17354 in favor of a new fix that better matches the behavior of other browsers.
  • kjs/lexer.h:
  • kjs/regexp.cpp: (KJS::RegExp::RegExp): (KJS::sanitizePattern): (KJS::isHexDigit): (KJS::convertHex): (KJS::convertUnicode):
  • kjs/regexp.h: Translate \u escaped unicode characters for the benefit of pcre.
  • kjs/ustring.cpp: (KJS::UString::append): Fix failure to increment length on the first UChar appended to a UString that was copy-on-write.
  • tests/mozilla/ecma_2/RegExp/properties-001.js: Adjust tests back to the uniform standards.

LayoutTests:

  • fast/js/kde/RegExp-expected.txt:
  • fast/js/regexp-unicode-handling-expected.txt: Adjust these test results to passing as a result of other included changes in this revision.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/regexp.h

    r13089 r17862  
    6262    RegExp(const RegExp &);
    6363    RegExp &operator=(const RegExp &);
     64
     65    static UString sanitizePattern(const UString&);
     66
     67    static bool isHexDigit(UChar);
     68    static unsigned char convertHex(int);
     69    static unsigned char convertHex(int, int);
     70    static UChar convertUnicode(UChar, UChar, UChar, UChar);
    6471  };
    6572
Note: See TracChangeset for help on using the changeset viewer.