From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../string-substring-latin1rope-with-twobyte-children.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 js/src/jit-test/tests/basic/string-substring-latin1rope-with-twobyte-children.js (limited to 'js/src/jit-test/tests/basic/string-substring-latin1rope-with-twobyte-children.js') diff --git a/js/src/jit-test/tests/basic/string-substring-latin1rope-with-twobyte-children.js b/js/src/jit-test/tests/basic/string-substring-latin1rope-with-twobyte-children.js new file mode 100644 index 0000000000..3a1d889073 --- /dev/null +++ b/js/src/jit-test/tests/basic/string-substring-latin1rope-with-twobyte-children.js @@ -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"); -- cgit v1.2.3