diff options
author | Nathan Rajlich <nathan@tootallnate.net> | 2012-07-25 21:34:13 +0400 |
---|---|---|
committer | Nathan Rajlich <nathan@tootallnate.net> | 2012-07-25 21:41:08 +0400 |
commit | 9eddaebb79ff1954b7ecdb209587d7db6554580d (patch) | |
tree | 6974e547487599911bbc4248917c2690810f3c31 /lib | |
parent | b207e24bcd168a5ca538476ee0b3b0960cdc6759 (diff) |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/assert.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/assert.js b/lib/assert.js index 7e932be14a1..50a6920a23e 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -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 |