Constnium/node_modules/function.prototype.name/test/shimmed.js
2022-06-23 02:27:43 +02:00

21 lines
628 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
require('../auto');
var test = require('tape');
var supportsDescriptors = require('define-properties').supportsDescriptors;
var isEnumerable = Object.prototype.propertyIsEnumerable;
var runTests = require('./tests');
test('shimmed', function (t) {
t.test('enumerability', { skip: !supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Function.prototype, 'name'), 'Function#name is not enumerable');
et.equal(false, isEnumerable.call(function foo() {}, 'name'), 'a functions name is not enumerable');
et.end();
});
runTests(function (fn) { return fn.name; }, t);
t.end();
});