Permalink
Browse files

assert: remove unnecessary use of __proto__

AssertionError already inherits from Error above using util.inherits(),
so this extra line was redundant.

test/simple/test-assert.js already tests for `instanceof`, and still passes.
  • Loading branch information...
1 parent e4c9c9f commit da667a9d8de514a7c12cc3536af3de9bdd68983a @TooTallNate committed Jul 25, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/assert.js
View
@@ -49,6 +49,8 @@ assert.AssertionError = function AssertionError(options) {
Error.captureStackTrace(this, stackStartFunction);
}
};
+
+// assert.AssertionError instanceof Error
util.inherits(assert.AssertionError, Error);
function replacer(key, value) {
@@ -85,10 +87,6 @@ assert.AssertionError.prototype.toString = function() {
}
};
-// assert.AssertionError instanceof Error
-
-assert.AssertionError.__proto__ = Error.prototype;
-
// At present only the three keys mentioned above are used and
// understood by the spec. Implementations or sub modules can pass
// other keys to the AssertionError's constructor - they will be

0 comments on commit da667a9

Please sign in to comment.