mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
lib: use primordials when calling methods of Error
This is to unsure that code using those methods won't crash if the methods are deleted in userland. PR-URL: https://github.com/nodejs/node/pull/35837 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
This commit is contained in:
1 parent
05bb1b3f94
commit
1da672994a
8 files changed
+23
-37
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
const {
|
||||
Error,
|
||||
ErrorCaptureStackTrace,
|
||||
MathMax,
|
||||
ObjectCreate,
|
||||
ObjectDefineProperty,
|
||||
@@ -444,8 +445,7 @@ class AssertionError extends Error {
|
||||
this.expected = expected;
|
||||
this.operator = operator;
|
||||
}
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
Error.captureStackTrace(this, stackStartFn || stackStartFunction);
|
||||
ErrorCaptureStackTrace(this, stackStartFn || stackStartFunction);
|
||||
// Create error message including the error code in the name.
|
||||
this.stack;
|
||||
// Reset the name.
|
||||
|
||||
Reference in new issue
Block a user