Sha256: 9a3b014d9a41f895886b42a9e7b71c21c56f52840b3439b555438c1e89f68897
Contents?: true
Size: 477 Bytes
Versions: 41
Compression:
Stored size: 477 Bytes
Contents
'use strict'; var test = require('tape'); var hasProto = require('../'); test('hasProto', function (t) { var result = hasProto(); t.equal(typeof result, 'boolean', 'returns a boolean (' + result + ')'); var obj = { __proto__: null }; if (result) { t.notOk('toString' in obj, 'null object lacks toString'); } else { t.ok('toString' in obj, 'without proto, null object has toString'); t.equal(obj.__proto__, null); // eslint-disable-line no-proto } t.end(); });
Version data entries
41 entries across 41 versions & 2 rubygems