Bug 200070
Summary: | Regular expression bug of javascriptCore: String search method invalid | ||
---|---|---|---|
Product: | WebKit | Reporter: | yaohouyou |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | fpizlo, msaboff, webkit-bug-importer, ysuzuki |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Local Build | ||
Hardware: | PC | ||
OS: | Linux |
yaohouyou
#Testcase:
1 var func = function() {
2 var reg = /(\w*)+=/;
3 var str1 = '4anything4654sASD:language=';
4 // var str2 = '4any4654sASD:language=';
5 print(str1.search(reg));
6 // print(str2.search(reg));
7 };
8
9 func();
#Command:
./webkit/WebKitBuild/Release/bin/jsc testcase.js
#Output:
-1
#Expected output:
18
#Description:
When executing the above testcase, the expected output should be “18” according to ECMAScript-262 standard. However, JavaScriptCore outputs -1 while other JS engines such as V8, SpiderMonkey output “18”. In addition, when I comment str1(line 3) and use str2 (line 4), JavaScriptCore outputs “13”. So I suspect that it’s a bug of JavaScriptCore.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/53502691>