forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1884649: Add test and comments. r=jandem
Depends on D204330 Differential Revision: https://phabricator.services.mozilla.com/D204331
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
js/src/jit-test/tests/basic/string-substring-latin1rope-with-twobyte-children.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
let right = newRope("b", "012345678901234567890123456789"); | ||
let latin1Rope = newRope("a", right); | ||
let twoByteRope = newRope("\u221e", right); | ||
|
||
// Flattening |twoByteRope| changes |right| from a Latin-1 rope into a two-byte | ||
// dependent string. At this point, |latin1Rope| has the Latin-1 flag set, but | ||
// also has a two-byte rope child. | ||
ensureLinearString(twoByteRope); | ||
|
||
let result = latin1Rope.substring(0, 3); | ||
|
||
assertEq(result, "ab0"); |
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