MCPcopy
hub / github.com/zloirock/core-js / getCheck

Function getCheck

tests/unit-global/es.number.constructor.js:4–12  ·  view source on GitHub ↗
(assert)

Source from the content-addressed store, hash-verified

2import { nativeSubclass } from '../helpers/helpers.js';
3
4function getCheck(assert) {
5 return function (a, b) {
6 assert.same(Number(a), b, `Number ${ typeof a } ${ a } -> ${ b }`);
7 const x = new Number(a);
8 assert.same(x, Object(x), `new Number ${ typeof a } ${ a } is object`);
9 assert.same({}.toString.call(x).slice(8, -1), 'Number', `classof new Number ${ typeof a } ${ a } is Number`);
10 assert.same(x.valueOf(), b, `new Number(${ typeof a } ${ a }).valueOf() -> ${ b }`);
11 };
12}
13
14QUnit.test('Number constructor: regression', assert => {
15 const check = getCheck(assert);

Callers 1

Calls 1

valueOfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…