From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- js/src/jit-test/tests/auto-regress/bug674843.js | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 js/src/jit-test/tests/auto-regress/bug674843.js (limited to 'js/src/jit-test/tests/auto-regress/bug674843.js') diff --git a/js/src/jit-test/tests/auto-regress/bug674843.js b/js/src/jit-test/tests/auto-regress/bug674843.js new file mode 100644 index 0000000000..ff1167c9bb --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug674843.js @@ -0,0 +1,63 @@ +// Binary: cache/js-dbg-64-d066929dd830-linux +// Flags: -m +// +function fnSupportsArrayIndexGettersOnObjects() { + if (fnExists(Object.defineProperty)) { + var obj = {}; + Object.defineProperty(obj, "0", { + get: function () { + supportsArrayIndexGettersOnObjects = true; + } + }); + var res = obj[0]; + } + return supportsArrayIndexGettersOnObjects; +} +function fnExists( /*arguments*/ ) { + return true; +} +var ES5Harness = (function () { + var $this = this; + function registerTest(test) { + if (!(test.precondition && !test.precondition())) { + try { + var res = test.test.call($this); + } catch (e) {} + } + } + return { + registerTest: registerTest + } +})(); +ES5Harness.registerTest({ + test: function testcase() { + function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 1) {} + } + var obj = { + length: 10 + }; + Object.defineProperty(obj, "0", { + get: function () { + defineProperty(idx, idx, registerTest + ": }}}}}"); + }, + }); + try { + Array.prototype.reduce.call(obj, callbackfn, "initialValue"); + } finally {} + }, + precondition: function prereq() { + return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects(); + } +}); +ES5Harness.registerTest({ + test: function testcase() { + var obj = {}; + Object.defineProperty(obj, "property", { + configurable: new Date() + }); + }, + precondition: function prereq() { + return fnExists(gczeal(2)); + } +}); -- cgit v1.2.3