summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/number-methods-this-error.js
blob: 6d5a710bb141683d60543b9f42b0ddc1a807c5c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
load(libdir + "asserts.js");

let methods = Object.getOwnPropertyNames(Number.prototype)
                    .filter(n => n != "constructor");

for (let method of methods) {
  assertTypeErrorMessage(() => Number.prototype[method].call(new Map),
    `Number.prototype.${method} called on incompatible Map`);

  assertTypeErrorMessage(() => Number.prototype[method].call(false),
    `Number.prototype.${method} called on incompatible boolean`);
}