Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
1.7.1
-
None
-
Windows 10 x86
Qt Creator 4.2.1
Description
Here is a test qbs project.
For each case lastIndexOf always returns -1.
import qbs Product { type: ["dummy"] Rule { multiplex: true alwaysRun: true Artifact { filePath: "dummy.txt" fileTags: ["dummy"] } prepare: { var cmd = new JavaScriptCommand(); cmd.silent = false; cmd.description = 'Testing JavaScript'; cmd.sourceCode = function() { var str1 = "C:/dir1/dir2/dir3"; var index1 = str1.indexOf('/'); var index2 = str1.lastIndexOf("/"); console.error('indexes: ' + index1 + ' ' + index2); var str2 = "bbbbaaaaa"; console.error('indexes: ' + str2.indexOf("a") + ' ' + str2.lastIndexOf("a")); var str3 = "112211221"; console.error('indexes: ' + str3.indexOf("2") + ' ' + str3.lastIndexOf("2")); }; return [cmd]; } } }
Attachments
Issue Links
- duplicates
-
QTBUG-54287 [REG 5.6.0->5.6.1] lastIndexOf on a string always returns -1 in Release build
- Closed