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:
Jackson Tian 2016-02-08 21:12:09 +08:00 committed by James M Snell
parent 826844e27e
commit cc195bf37b
6 changed files with 12 additions and 9 deletions

View file

@ -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);