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.
This commit is contained in:
parent
b207e24bcd
commit
9eddaebb79
@ -49,6 +49,8 @@ assert.AssertionError = function AssertionError(options) {
|
|||||||
Error.captureStackTrace(this, stackStartFunction);
|
Error.captureStackTrace(this, stackStartFunction);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// assert.AssertionError instanceof Error
|
||||||
util.inherits(assert.AssertionError, Error);
|
util.inherits(assert.AssertionError, Error);
|
||||||
|
|
||||||
function replacer(key, value) {
|
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
|
// At present only the three keys mentioned above are used and
|
||||||
// understood by the spec. Implementations or sub modules can pass
|
// understood by the spec. Implementations or sub modules can pass
|
||||||
// other keys to the AssertionError's constructor - they will be
|
// other keys to the AssertionError's constructor - they will be
|
||||||
|
Loading…
x
Reference in New Issue
Block a user