Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Regression(r173761): ASSERTION FAILED: !is8Bit() in StringImpl::chara…
…cters16() https://bugs.webkit.org/show_bug.cgi?id=142350 Patch by Chris Dumez <cdumez@apple.com> on 2015-03-05 Reviewed by Michael Saboff and Benjamin Poulain. Source/JavaScriptCore: Call WTFString::hasInfixStartingAt() / hasInfixEndingAt() now that these methods have been renamed for clarity. * runtime/StringPrototype.cpp: (JSC::stringProtoFuncStartsWith): (JSC::stringProtoFuncEndsWith): Source/WTF: Fix ASSERTION FAILED: !is8Bit() in StringImpl::characters16() from WTF::equalInner() after r173761. The code was incorrectly assuming that if stringImpl is 16-bit, then matchString is 16-bit too, which is not correct. Also rename WTFString::startsWith() / endsWith() taking an offset to hasInfixStartingAt() / hasInfixEndingAt() for clarity. It seems odd to call it startsWith even though it won't technically *start* with the pattern if the input offset is greater than zero. Also drop the caseSensitive argument as it is never used (always true at call sites. * wtf/text/StringImpl.cpp: (WTF::equalInner): (WTF::StringImpl::hasInfixStartingAt): (WTF::StringImpl::hasInfixEndingAt): (WTF::StringImpl::startsWith): Deleted. (WTF::StringImpl::endsWith): Deleted. * wtf/text/StringImpl.h: * wtf/text/WTFString.h: (WTF::String::hasInfixStartingAt): (WTF::String::hasInfixEndingAt): (WTF::String::startsWith): Deleted. (WTF::String::endsWith): Deleted. Tools: Add API test for WTFString::hasInfixStartingAt() to make sure it doesn't crash if the string is 8-bit but the pattern is 16-bit (and vice-versa). * TestWebKitAPI/Tests/WTF/WTFString.cpp: (TestWebKitAPI::TEST): LayoutTests: Update String.startsWith() / endsWith() test to cover cases where the input string is 8-bit and the pattern is 16-bit, and vice-versa. * js/script-tests/string-includes.js: * js/string-includes-expected.txt: Canonical link: https://commits.webkit.org/160395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
d1b8267
commit e7986d8d2023453a3bd4227cd895e53840c13eea
Showing
11 changed files
with
129 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters