From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../jit-test/tests/ion/call-generic-constructor.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 js/src/jit-test/tests/ion/call-generic-constructor.js (limited to 'js/src/jit-test/tests/ion/call-generic-constructor.js') diff --git a/js/src/jit-test/tests/ion/call-generic-constructor.js b/js/src/jit-test/tests/ion/call-generic-constructor.js new file mode 100644 index 0000000000..15a8c4b36f --- /dev/null +++ b/js/src/jit-test/tests/ion/call-generic-constructor.js @@ -0,0 +1,21 @@ +// Test that the generic call trampoline handles constructors correctly. + +function foo(f) { + return new f(1); +} + +with ({}) {} + +function f1(x) { this.x = x; } +function f2(y) { this.y = y; } +let f3 = f1.bind({}); +let f4 = f1.bind({}, 2); +let f5 = Uint8Array; + +for (var i = 0; i < 500; i++) { + assertEq(foo(f1).x, 1); + assertEq(foo(f2).y, 1); + assertEq(foo(f3).x, 1); + assertEq(foo(f4).x, 2); + assertEq(foo(f5)[0], 0); +} -- cgit v1.2.3