Sha256: 9b7d83ab5ff334eb53d87a9f11b166b68d6ce52711bf1f8270fb9ab9244abd13

Contents?: true

Size: 1.25 KB

Versions: 61

Compression:

Stored size: 1.25 KB

Contents

'use strict';

require('../auto');

var test = require('tape');
var defineProperties = require('define-properties');
var bind = require('function-bind');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = function f() {}.name === 'f';

var runTests = require('./tests');

test('shimmed', function (t) {
	t.equal(Array.prototype.flat.length, 0, 'Array#flat has a length of 0');
	t.test('Function name', { skip: !functionsHaveNames }, function (st) {
		st.equal(Array.prototype.flat.name, 'flat', 'Array#flat has name "flat"');
		st.end();
	});

	t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
		et.equal(false, isEnumerable.call(Array.prototype, 'flat'), 'Array#flat is not enumerable');
		et.end();
	});

	var supportsStrictMode = (function () { return typeof this === 'undefined'; }());

	t.test('bad array/this value', { skip: !supportsStrictMode }, function (st) {
		st['throws'](function () { return Array.prototype.flat.call(undefined, 'a'); }, TypeError, 'undefined is not an object');
		st['throws'](function () { return Array.prototype.flat.call(null, 'a'); }, TypeError, 'null is not an object');
		st.end();
	});

	runTests(bind.call(Function.call, Array.prototype.flat), t);

	t.end();
});

Version data entries

61 entries across 61 versions & 3 rubygems

Version Path
immosquare-cleaner-0.1.68 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.67 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.66 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.65 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.64 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.63 node_modules/array.prototype.flat/test/shimmed.js
rapid_stack-0.2.0 templates/frontend/node_modules/array.prototype.flat/test/shimmed.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/array.prototype.flat/test/shimmed.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.62 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.61 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.60 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.59 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.58 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.57 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.56 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.55 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.54 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.53 node_modules/array.prototype.flat/test/shimmed.js
immosquare-cleaner-0.1.52 node_modules/array.prototype.flat/test/shimmed.js