summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/self-hosting/getbuiltinconstructor.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/self-hosting/getbuiltinconstructor.js')
-rw-r--r--js/src/jit-test/tests/self-hosting/getbuiltinconstructor.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/self-hosting/getbuiltinconstructor.js b/js/src/jit-test/tests/self-hosting/getbuiltinconstructor.js
new file mode 100644
index 000000000..57134875a
--- /dev/null
+++ b/js/src/jit-test/tests/self-hosting/getbuiltinconstructor.js
@@ -0,0 +1,13 @@
+let getCtor = getSelfHostedValue('GetBuiltinConstructor');
+
+assertEq(getCtor('Array'), Array);
+
+let origArray = Array;
+Array = function(){};
+assertEq(getCtor('Array') == Array, false);
+assertEq(getCtor('Array'), origArray);
+
+let origMap = Map;
+Map = function(){};
+assertEq(getCtor('Map') == Map, false);
+assertEq(getCtor('Map'), origMap);