diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/jit-test/tests/auto-regress/bug730806.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/auto-regress/bug730806.js')
-rw-r--r-- | js/src/jit-test/tests/auto-regress/bug730806.js | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/auto-regress/bug730806.js b/js/src/jit-test/tests/auto-regress/bug730806.js new file mode 100644 index 0000000000..9c5ed54b7e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug730806.js @@ -0,0 +1,61 @@ +// Binary: cache/js-opt-32-2dc40eb83023-linux +// Flags: -m -n -a +// +function toPrinted(value) { + return value = value.replace(/\\n/g, 'NL') + .replace(/\\r/g, 'CR') + .replace(/[^\x20-\x7E]+/g, escapeString); +} +function escapeString (str) +{ + var a, b, c, d; + var len = str.length; + var result = ""; + var digits = ["0", "1", "2", "3", "4", "5", "6", "7", + "8", "9", "A", "B", "C", "D", "E", "F"]; + for (var i=0; i<len; i++) + { + var ch = str.charCodeAt(i); + a = digits[ch & 0xf]; + if (ch) + { + c = digits[ch & 0xf]; + ch >>= 4; + d = digits[ch & 0xf]; + result += "\\u" + d + c + b + a; + } + } +} +function reportCompare (expected, actual, description) { +function test() { + try + { + } + catch(e) + { + } + } +} +try { +gczeal(2,4); +function setprop() { +} +} catch(exc1) {} +var trimMethods = ['trim', 'trimLeft', 'trimRight']; +var whitespace = [ + {s : '\u2028', t : 'LINE SEPARATOR'}, + ]; +for (var j = 0; j < trimMethods.length; ++j) +{ + var method = trimMethods[j]; + for (var i = 0; i < whitespace.length; ++i) + { + var v = whitespace[i].s; + var t = whitespace[i].t; + v = v + v + v; + str = v; + expected = ''; + actual = str[method](); + reportCompare(expected, actual, t + ':' + '"' + toPrinted(str) + '".' + method + '()'); + } +} |