Backed out changeset 2b10a37f9a23 (bug 1863390) for causing JSRope related SM bustages. CLOSED TREE

This commit is contained in:
Stanca Serban 2023-11-08 13:06:44 +02:00
parent 741d5e91ef
commit 95f0e10b39
2 changed files with 0 additions and 16 deletions

View File

@ -676,16 +676,6 @@ JSString* js::SubstringKernel(JSContext* cx, HandleString str, int32_t beginInt,
return nullptr;
}
// The dependent string of a two-byte string can be a Latin-1 string, so
// check again if the result fits into an inline string.
if (left->hasLatin1Chars() && right->hasLatin1Chars()) {
if (JSInlineString::lengthFits<Latin1Char>(len)) {
MOZ_ASSERT(rope->hasTwoByteChars(), "Latin-1 ropes are handled above");
return SubstringInlineString<Latin1Char>(cx, left, right, 0, lhsLength,
rhsLength);
}
}
return JSRope::new_<CanGC>(cx, left, right, len);
}

View File

@ -1,6 +0,0 @@
var left = "left-rope-child";
var right = newString("right-rope-child", {twoByte: true});
var rope = newRope(left, right);
var result = rope.substring(0, left.length + 1);
assertEq(result, "left-rope-childr");