summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/self-hosting/getbuiltinconstructor.js
blob: 57134875a5565723f9b1ba0e9c3ea9cca6cc576f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);