mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 14:18:44 +02:00
tools: enable no-proto rule for linter
Enable `no-proto` in `.eslintrc`. Use `Object.setPrototypeOf()` and `Object.getPrototypeOf()` instead of. PR-URL: https://github.com/nodejs/node/pull/5140 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
826844e27e
commit
cc195bf37b
6 changed files with 12 additions and 9 deletions
|
@ -40,8 +40,8 @@ assert.equal(dv.getFloat64(8, true), 3.1415);
|
|||
|
||||
assert.throws(function() {
|
||||
function AB() { }
|
||||
AB.__proto__ = ArrayBuffer;
|
||||
AB.prototype.__proto__ = ArrayBuffer.prototype;
|
||||
Object.setPrototypeOf(AB, ArrayBuffer);
|
||||
Object.setPrototypeOf(AB.prototype, ArrayBuffer.prototype);
|
||||
new Buffer(new AB());
|
||||
}, TypeError);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue