Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

inspect-js/has-proto

github actionscoverageLicenseDownloads

npm badge

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

Example

varhasProto=require('has-proto');varassert=require('assert');assert.equal(typeofhasProto(),'boolean');varhasProtoAccessor=require('has-proto/accessor')();if(hasProtoAccessor){assert.equal([].__proto__,Array.prototype);}else{assert(!('__proto__'inObject.prototype));}varhasProtoMutator=require('has-proto/mutator');varobj={};assert('toString'inobj);obj.__proto__=null;if(hasProtoMutator){assert(!('toString'inobj));}else{assert('toString'inobj);assert.equal(obj.__proto__,null);}

Tests

Simply clone the repo,npm install, and runnpm test

About

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

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp