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/jaeger/testPropCallElem.js | 93 ++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 js/src/jit-test/tests/jaeger/testPropCallElem.js (limited to 'js/src/jit-test/tests/jaeger/testPropCallElem.js') diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem.js b/js/src/jit-test/tests/jaeger/testPropCallElem.js new file mode 100644 index 0000000000..2bb97fbe64 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testPropCallElem.js @@ -0,0 +1,93 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function testUKeyUObject(a, key1, key2, key3) { + a.a = function () { return this.d; } + a.b = function () { return this.e; } + a.c = function() { return this.f; } + a.d = 20; + a.e = "hi"; + a.f = 500; + assertEq(a[key1](), 20); + assertEq(a[key2](), "hi"); + assertEq(a[key3](), 500); +} + +function testVKeyUObject(a, key1, key2, key3) { + a.a = function () { return this.d; } + a.b = function () { return this.e; } + a.c = function() { return this.f; } + a.d = 20; + a.e = "hi"; + a.f = 500; + assertEq(a["" + key1](), 20); + assertEq(a["" + key2](), "hi"); + assertEq(a["" + key3](), 500); +} + +function testKKeyUObject(a) { + a.a = function () { return this.d; } + a.b = function () { return this.e; } + a.c = function() { return this.f; } + a.d = 20; + a.e = "hi"; + a.f = 500; + var key1 = "a"; + var key2 = "b"; + var key3 = "c"; + assertEq(a[key1](), 20); + assertEq(a[key2](), "hi"); + assertEq(a[key3](), 500); +} + +function testUKeyVObject(key1, key2, key3) { + a = { a: function () { return this.d; }, + b: function () { return this.e; }, + c: function () { return this.f; }, + d: 20, + e: "hi", + f: 500 + }; + assertEq(a[key1](), 20); + assertEq(a[key2](), "hi"); + assertEq(a[key3](), 500); +} + +function testVKeyVObject(key1, key2, key3) { + a = { a: function () { return this.d; }, + b: function () { return this.e; }, + c: function () { return this.f; }, + d: 20, + e: "hi", + f: 500 + }; + assertEq(a["" + key1](), 20); + assertEq(a["" + key2](), "hi"); + assertEq(a["" + key3](), 500); +} + +function testKKeyVObject(a) { + a = { a: function () { return this.d; }, + b: function () { return this.e; }, + c: function () { return this.f; }, + d: 20, + e: "hi", + f: 500 + }; + var key1 = "a"; + var key2 = "b"; + var key3 = "c"; + assertEq(a[key1](), 20); + assertEq(a[key2](), "hi"); + assertEq(a[key3](), 500); +} + +for (var i = 0; i < 5; i++) { + testUKeyUObject({}, "a", "b", "c"); + testVKeyUObject({}, "a", "b", "c"); + testKKeyUObject({}); + testUKeyVObject("a", "b", "c"); + testVKeyVObject("a", "b", "c"); + testKKeyVObject(); +} + + -- cgit v1.2.3