2311061106/frontend/node_modules/has-proto
23175 b8b09fd9d4
Some checks failed
autograde-final-vibevault / check-trigger (push) Successful in 13s
autograde-final-vibevault / grade (push) Failing after 55s
完成作业
2025-12-14 16:02:40 +08:00
..
.github 完成作业 2025-12-14 16:02:40 +08:00
test 完成作业 2025-12-14 16:02:40 +08:00
.eslintrc 完成作业 2025-12-14 16:02:40 +08:00
accessor.d.ts 完成作业 2025-12-14 16:02:40 +08:00
accessor.js 完成作业 2025-12-14 16:02:40 +08:00
CHANGELOG.md 完成作业 2025-12-14 16:02:40 +08:00
index.d.ts 完成作业 2025-12-14 16:02:40 +08:00
index.js 完成作业 2025-12-14 16:02:40 +08:00
LICENSE 完成作业 2025-12-14 16:02:40 +08:00
mutator.d.ts 完成作业 2025-12-14 16:02:40 +08:00
mutator.js 完成作业 2025-12-14 16:02:40 +08:00
package.json 完成作业 2025-12-14 16:02:40 +08:00
README.md 完成作业 2025-12-14 16:02:40 +08:00
tsconfig.json 完成作业 2025-12-14 16:02:40 +08:00

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