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

@ -24,8 +24,9 @@ const vals = [new T(4), T(4)];
vals.forEach(function(t) {
assert.equal(t.constructor, T);
assert.equal(t.__proto__, T.prototype);
assert.equal(t.__proto__.__proto__, Buffer.prototype);
assert.equal(Object.getPrototypeOf(t), T.prototype);
assert.equal(Object.getPrototypeOf(Object.getPrototypeOf(t)),
Buffer.prototype);
t.fill(5);
let cntr = 0;