学习?学个屁 06c63c15cc 初始化提交 před 10 měsíci
..
.github 06c63c15cc 初始化提交 před 10 měsíci
test 06c63c15cc 初始化提交 před 10 měsíci
.eslintrc 06c63c15cc 初始化提交 před 10 měsíci
CHANGELOG.md 06c63c15cc 初始化提交 před 10 měsíci
LICENSE 06c63c15cc 初始化提交 před 10 měsíci
README.md 06c63c15cc 初始化提交 před 10 měsíci
accessor.d.ts 06c63c15cc 初始化提交 před 10 měsíci
accessor.js 06c63c15cc 初始化提交 před 10 měsíci
index.d.ts 06c63c15cc 初始化提交 před 10 měsíci
index.js 06c63c15cc 初始化提交 před 10 měsíci
mutator.d.ts 06c63c15cc 初始化提交 před 10 měsíci
mutator.js 06c63c15cc 初始化提交 před 10 měsíci
package.json 06c63c15cc 初始化提交 před 10 měsíci
tsconfig.json 06c63c15cc 初始化提交 před 10 měsíci

README.md

has-proto Version Badge

github actions coverage License Downloads

npm badge

Does this environment have the ability to set the [[Prototype]] of an object on creation with __proto__?

Example

var hasProto = require('has-proto');
var assert = require('assert');

assert.equal(typeof hasProto(), 'boolean');

var hasProtoAccessor = require('has-proto/accessor')();
if (hasProtoAccessor) {
	assert.equal([].__proto__, Array.prototype);
} else {
	assert(!('__proto__' in Object.prototype));
}

var hasProtoMutator = require('has-proto/mutator');
var obj = {};
assert('toString' in obj);

obj.__proto__ = null;
if (hasProtoMutator) {
	assert(!('toString' in obj));
} else {
	assert('toString' in obj);
	assert.equal(obj.__proto__, null);
}

Tests

Simply clone the repo, npm install, and run npm test