mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00: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:
committed by
James M Snell
parent
826844e27e
commit
cc195bf37b
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user