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 authored and Myles Borins committed 2016-03-02 14:01:11 -08:00
1 parent 8727d7ac66
commit fc50bbfa1a
6 files changed
+12 -9

No files matched your search

+2 -2
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);