stringProtoFuncReplace converts 8 bit strings to 16 bit during replacement
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 18:51:36 +0000 (18:51 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 18:51:36 +0000 (18:51 +0000)
commit5f40cbb9a21ea0d901af9f971679988fa004c04b
treea4b6b1b21bfb6998efab1d1ff876450d47fd0937
parent3a8df7cf0ad417b43f75050e91cc6b06398a7846
stringProtoFuncReplace converts 8 bit strings to 16 bit during replacement
https://bugs.webkit.org/show_bug.cgi?id=76651

Reviewed by Geoffrey Garen.

Made local function substituteBackreferencesSlow a template function
based on character width.  Cleaned up getCharacters() in both UString
and StringImpl.  Changed getCharacters<UChar> to up convert an 8 bit
string to 16 bits if necessary.

* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow):
(JSC::substituteBackreferences):
* runtime/UString.h:
(JSC::LChar):
(JSC::UChar):
* wtf/text/StringImpl.h:
(WTF::UChar):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/StringPrototype.cpp
Source/JavaScriptCore/runtime/UString.h
Source/JavaScriptCore/wtf/text/StringImpl.h