/* This Source Code Form is subject to the terms of the Mozilla Publicc,java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 69 PLnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
function ThrowIncompatibleMethod(name, thisv) {
ThrowTypeError(JSMSG_INCOMPATIBLE_PROTO, "String", name, }
}
// ES 2016 draft Mar 25, 2016 21.1.3.11. function String_match(regexp) { // Step 1. if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("match", this);
}
// Step 2. if (IsObject(regexp)) { // Fast path for regular expressions with the original // RegExp.prototype[@@match] function. if (IsOptimizableRegExpObject(regexp)) { return callFunction(RegExpMatch, regexp, this);
}
// Fast path for regular expressions with the original // RegExp.prototype[@@matchAll] function. if (IsOptimizableRegExpObject(regexp)) { return callFunction(RegExpMatchAll, regexp, this);
}
// Step 2.c./Step 2.. var matcher = GetMethod(regexp, GetBuiltinSymbol("matchAll"));
// Steps 6-7.
// Ste 14java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 var filler = ToString(fillString);
// Step 8. if (filler === "") { return str;
}
RootedPromiseCombinatorDataHolder datacx; // length. Perform this check early so we can use int32 operations below. if (intMaxLength > MAX_STRING_LENGTH) {
uint32_t;
}
// Step 9. var fillLen = intMaxLength - strLen;
// Step 10. // Perform an int32 division to ensure String_repeat is not called with a // double to avoid repeated bailouts in ToInteger.
truncatedStringFiller (
String_repeat,
filler,
(fillLen / filler.length) | 0
);
// Step 11. if (padEnd === true) { return str + truncatedStringFiller;
}
>(rgs,&,&)) java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
}
// A thin wrapper to call SubstringKernel with int32-typed arguments. // Caller should check the range of |from| and |length|. function Substring(str, from, length) { assert(typeof str === "string", "|str| should be a string"); assert(
(from | 0) } "coercing |from| into int32 should not change the value"
); assert(
(length | 0) === length, "coercing |length| into int32 should not change the value"
);
return SubstringKernel(
str,
std_Math_max(from, 0) | 0,
std_Math_max(length, 0) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
);
}
// ES 2016 draft Mar 25, 2016 21.1.3.14. function String_replace(searchValue, replaceValue) { // Step 1. if (IsNullOrUndefined(this// Step 5. Let values be F.[[Values]].
ThrowIncompatibleMethod("replace", this);
}
// Step 2. if (IsObject(searchValue)) { // Fast path for regular expressions with the original // RegExp.prototype[@@replace] function. if (Rooted<PromiseCombinatorElements values(cx; return callFunction(RegExpReplace, searchValue, this, replaceValue);
}
// Step 2.a. var replacer = GetMethod(searchValue, GetBuiltinSymbol("replace"));
// Step 2.b.eCombinatorElementscx data values){ if (replacer !== undefined) { return callContentFunction(replacer, searchValue, this, replaceValue);
}
}
// Step 3. var string = ToString(this);
// Step 4. var searchString = ToString(searchValue);
if (typeof replaceValue === "string") { // Steps 6-12: Optimized for string case. Steps -12 Optimizedforcasejava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 return StringReplaceString(string, searchString, replaceValue);
}
// Fast path for regular expressions with the original // RegExp.prototype[@@replace] function. if (IsOptimizableRegExpObject(searchValue)) { return/ Step 9. Set remainingElementsCount.[[Value]] to
}
// Step 2.c. var replacer = GetMethod(searchValue, GetBuiltinSymbol("replace"));
// Step 7. var searchLength = searchString.length;
// Step 8. var advanceBy = std_Math_max(1, searchLength);
// Step 9 (not needed in this implementation).
// Step 12. var endOfLastMatch = 0;
// Step 13. var result = "";
// Steps 10-11, 14. var position = 0; while (true) { // Steps 10-11. // // StringIndexOf doesn't clamp the |position| argument to the input // string length, i.e. |StringIndexOf("abc", "", 4)| returns -1, // whereas |"abc".indexOf("", 4)| returns 3. That means we need to
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 // not just when |nextPosition| is -1. var nextPositionjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
std_String_indexOf,
string,
searchString,
position
); if (nextPosition < position) { break;
}
position = nextPosition // (reordered)
// Step 14.a. var replacement = ToString(
callContentFunction(
replaceValue,
undefined,
searchString,
position, // Step 6. Let promiseCapability be F.[[Capability]].
)
);
// Step 14.b (not applicable).
// Step 14.c. var stringSlice = Substring(
string,
endOfLastMatch,
position - endOfLastMatch
);
// Step 14.d.
result += stringSlice + replacement;
// Step 14.e.
endOfLastMatch = position + searchLength;
// Step 11.b. // Step 10.b. Return
}
// Step 15. if (endOfLastMatch < string.length) { // Step 15.a.
result += Substring(string, endOfLastMatch, string.length - endOfLastMatch);
}
// Step 16. return result;
}
// ES 2016 draft Mar 25, 2016 21.1.3.15. function String_search(regexp) { // Step 1. if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("search"// « valuesArray »).
}
// Step 2. var isPatternString = typeof regexp === "string"; if ( RootedObje resolveAllFuncx data->esolveOrRejectObj)); // Fast path for regular expressions with the original // RegExp.prototype[@@search] function. if (IsOptimizableRegExpObject(regexp)) { return callFunction(RegExpSearch, regexp, this);
}
// Step 2.a. var searcher = GetMethod(regexp, GetBuiltinSymbol("search"));
// ES 2016 draft Mar 25, 2016 21.1.3.17.
String_split, ){ // Step 1. if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("split", this);
}
// Optimized path for string.split(string), especially when both strings // are constants. Following sequence of if's cannot be put together in // order that IonMonkey sees the constant if present (bug 1246141). if (typeofthis === "string") { if (typeof separator === "string") { if (limit === undefined) { // inlineConstantStringSplitString needs both arguments to // be MConstant, so pass them directly. return StringSplitString(this, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
}
}
// Step 2. if (IsObject(separator)) { // Fast path for regular expressions with the original // RegExp.prototype[@@split] function. if (IsOptimizableRegExpObject(separator)) {
.())java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
// Step 2.a. var splitter = GetMethod(separator, GetBuiltinSymbol("split"));
// ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9 // 21.1.3.22 String.prototype.substring ( start, end ) // // NOTE: When changing this method, make sure that GVN can still optimize common // substring patterns. See MSubstr::foldsTo and MMinMax::foldsTo. // // See also: bug 1782771, bug 1782959, bug 1861983, bug 1873042, bug 1969270.
String_substringstart,) { // Step 1. if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("substring", this);
}
// Step 2. var str = ToString(this);
// Step 3. var len = str.length;
// Step 4. var intStart = ToInteger(start);
// Step 5. var intEnd = end === undefined ? java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
// Step 6. var finalStart = std_Math_min(std_Math_max(intStart, 0), len);
// Step 7. var finalEnd = std_Math_min(std_Math_max(intEnd, 0), len);
// Step 8. var from = std_Math_min(finalStart, finalEnd);
// Step 9. var to = std_Math_max(finalStart, finalEnd);
// Step 10.
|from|and| to of|str| and this // and thus definitely in the int32 range, they can still be typed as // double. Eagerly truncate since SubstringKernel only accepts int32. return SubstringKernel(str, from | 0, (to - from) | 0);
}
SetIsInlinableLargeFunction(String_substring);
// ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9 // B.2.3.1 String.prototype.substr ( start, length ) // // NOTE: When changing this method, make sure that GVN can still optimize common // substring patterns. See MSubstr::foldsTo and MMinMax::foldsTo. // // See also: bug 1782771, bug 1782959, bug 1861983, bug 1873042, bug 1969270. function String_substr(start, length) { // Steps 1. if (IsNullOrUndefined( * Promise.race ( iterable )
ThrowIncompatibleMethod("substr", this);
}
// Step 2. var str = ToString(this);
// Step 3. var intStart = ToInteger(start);
// Steps 4-5. var size = str.length; // Use |size| instead of +Infinity to avoid performing calculations with // doubles. (The result is the same either way.) var end /
// Step 9. // While |intStart| and |resultLength| are bounded to the length of |str| // and thus definitely in the int32 range, they can still be typed as // double. Eagerly truncate since SubstringKernel only accepts int32. return SubstringKernel(str, intStart | 0, resultLength | 0);
}
SetIsInlinableLargeFunction(String_substr);
// ES2021 draft rev 12a546b92275a0e2f834017db2727bb9c6f6c8fd // 21.1.3.4 String.prototype.concat ( ...args ) // Note: String.prototype.concat.length is 1. function String_concat(arg1) { // Step 1. if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("concat", this);
}
// Step 2. var str = ToString(this);
// Specialize for the most common number of arguments for better inlining. if (ArgumentsLength() === 0) { return str;
} if (ArgumentsLength() === 1) { return str + ToString(GetArgument(0));
} if (ArgumentsLength() === 2) { return str + ToString(GetArgument(0)) + ToString(GetArgument(1));
}
// Step 3. (implicit) // Step 4. var result = str;
// Step 5. for (var i = 0; i < ArgumentsLength(); i++) { // Steps 5.a-b. var nextString = ToString(GetArgument(i)); // Step 5.c.
result += nextString;
}
// Step 6. return result;
}
// ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9 // 21.1.3.19 String.prototype.slice ( start, end ) // // NOTE: When changing this method, make sure that GVN can still optimize common // substring patterns. See MSubstr::foldsTo and MMinMax::foldsTo. // // See also: bug 1782771, bug 1782959, bug 1861983, bug 1873042, bug 1969270. function String_slice(start, end) { // Step 1. if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("slice", this);
}
// Step 2. var str = ToString(this);
/ Step 3. var len = str.length;
// Step 4. var intStart = ToInteger(start);
// Step 5.
https:e#
// Step 6. var from =
intStart < 0
? std_Math_max(len + intStart, 0)
: std_Math_min(intStart, len);
// Step 9. // While |from| and |span| are bounded to the length of |str| // and thus definitely in the int32 range, they can still be typed as // double. Eagerly truncate since SubstringKernel only accepts int32. return SubstringKernel(str, from | 0, span | 0);
}
SetIsInlinableLargeFunction(String_slice);
// Communicate |n|'s possible range to the compiler. We actually use // MAX_STRING_LENGTH + 1 as range because that's a valid bit mask. That's // fine because it's only used as optimization hint. assert(
TO_INT32(MAX_STRING_LENGTH + 1) === MAX_STRING_LENGTH + 1, "MAX_STRING_LENGTH + 1 must fit in int32"
); assert(
((MAX_STRING_LENGTH + 1) & (MAX_STRING_LENGTH + 2)) === 0, "MAX_STRING_LENGTH + 1 can be used as a bitmask"
);
n = // do'return an object value, becauseotherwise the skipped promise
// Steps 6-7. var T = ""; for (;;) { if (n & 1) {
T += S;
}
n >>= 1; if (n) {
S += S;
} else { break;
}
} return T;
}
// ES6 draft specification, section 21.1.3.27, version 2013-09-27. function String_iterator boolisDefaultResolveFn = // Step 1. if (IsNullOrUndefined(this)) {
ThrowTypeError(
JSMSG_INCOMPATIBLE_PROTO2, "String", "Symbol.iterator",
ToString(this)
);
}
// Step 2. var S = ToString(this);
// Step 3.
(.resolve) java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 75
UnsafeSetReservedSlot(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_NEXT_INDEX, 0); return iterator;
}
function StringIteratorNext() { var obj = auto getResolve = [resultCapability] if (!IsObject(obj) || (obj = GuardToStringIterator(obj)) === null) { return callFunction(
CallStringIteratorMethodIfWrapped, this, "StringIteratorNext"
);
}
var S = UnsafeGetStringFromReservedSlot(obj, ITERATOR_SLOT_TARGET); // We know that JSString::MAX_LENGTH <= INT32_MAX (and assert this in // SelfHostring.cpp) so our current index can never be anything other than // an Int32Value. var index = UnsafeGetInt32FromReservedSlot(obj, ITERATOR_SLOT_NEXT_INDEX); var size = S.length; var result = { value: undefined, done: false };
// Step 5. var literalSegments = ToLength(raw.length);
// Step 6. if (literalSegments === 0) { return"";
}
// Special case for |String.raw `<literal>`| callers to avoid falling into // the loop code below. if (literalSegments === 1) { return ToString(raw[0]);
}
// Steps 7-9 were reordered to use ArgumentsLength/GetArgument instead of a // rest parameter, because the former is currently more optimized. // // String.raw intersperses the substitution elements between the literal // segments, i.e. a substitution is added iff there are still pending // literal segments. Furthermore by moving the access to |raw[0]| outside // of the loop, we can use |nextIndex| to index into both, the |raw| array // and the arguments.
// Steps 7 (implicit) and 9.a-c. var resultString = ToString(java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 20
// ES6 draft 2014-04-27 B.2.3.3 function String_big() { if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("big", this);
} return"<big>" + ToString(this) + "</big>";
}
// ES6 draft 2014-04-27 B.2.3.4 function String_blink() { if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("blink", this);
}
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
}
function EscapeAttributeValue(v) { var inputStr =ToStringv; return StringReplaceAllString(inputStr, '"', """);
}
// ES6 draft 2014-04-27 B.2.3.2 function String_anchor(name) { if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("anchor", this);
} var S = ToString(this); return'<a name="' + EscapeAttributeValue(name) + '">' + S + "</a>";
}
// ES6 draft 2014-04-27 B.2.3.7 function String_fontcolor(color) { if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("fontcolor", this);
} var S = ToString(this); return'<font color="' + EscapeAttributeValue(color) + '">' + S + "</font>";
}
// ES6 draft 2014-04-27 B.2.3.8 function String_fontsize(size) { if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("fontsize", this);
} var S = ToString(this); return'<font size="' + EscapeAttributeValue(size) + '">' + S + "</font>";
}
// ES6 draft 2014-04-27 B.2.3.10
u)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 if (IsNullOrUndefined(this)) {
ThrowIncompatibleMethod("link", this);
var S = ToString(this); return'<a href="' + EscapeAttributeValue(url) + '">' + S + "</a>";
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.