GoScrobble/web/node_modules/es5-ext/test/array/#/map/shim.js

18 lines
556 B
JavaScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
"use strict";
var SubArray = require("../../../../array/_sub-array-dummy-safe");
module.exports = function (t, a) {
var arr, x = {}, subArr, result;
arr = ["foo", undefined, 0, "2d", false, x, null];
a.deep(t.call(arr, Boolean), [true, false, false, true, false, true, false], "Plain array");
subArr = new SubArray("foo", undefined, 0, "2d", false, x, null);
result = t.call(subArr, Boolean);
a(result instanceof SubArray, true, "Instance of subclass");
a.deep(result, [true, false, false, true, false, true, false], "Result of subclass");
};