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.51 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.50 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.49 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.48 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.47 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.46 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.45 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.44 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.43 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.42 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.41 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.40 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.39 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.38 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.32 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.31 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.30 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.29 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.28 node_modules/has-proto/test/index.js
immosquare-cleaner-0.1.27 node_modules/has-proto/test/index.js