NEW 200070
Regular expression bug of javascriptCore: String search method invalid
https://bugs.webkit.org/show_bug.cgi?id=200070
Summary Regular expression bug of javascriptCore: String search method invalid
yaohouyou
Reported 2019-07-23 18:27:17 PDT
#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
Radar WebKit Bug Importer
Comment 1 2019-07-24 10:32:36 PDT
Note You need to log in before you can comment on or make changes to this bug.