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

Version Path
immosquare-cleaner-0.1.26 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.25 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.24 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.23 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.22 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.21 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.20 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.19 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.18 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.17 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.16 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.14 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.13 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.12 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.11 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.10 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.9 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.8 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.7 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.6 node_modules/has-proto/test/index.js