Skip to content

Commit

Permalink
lib: fix assert throwing different error messages in ESM and CJS
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jan 18, 2024
1 parent cda0cb4 commit e87b61b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions patches/node/fix_assert_module_in_the_renderer_process.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if the override has been disabled.
This will be upstreamed.

diff --git a/lib/assert.js b/lib/assert.js
index b7d7a3da01d520984a5903cb9a0f1c288e0d5fa0..66a60c3726cd57e65db3e4fb57fb85721368c3ce 100644
index 9dfcf80a913942c93b206c6f871ac7807c7a7e81..4d25a22aedf7d7182bb709864e29b7e725336323 100644
--- a/lib/assert.js
+++ b/lib/assert.js
@@ -66,6 +66,7 @@ const { inspect } = require('internal/util/inspect');
Expand All @@ -24,7 +24,7 @@ index b7d7a3da01d520984a5903cb9a0f1c288e0d5fa0..66a60c3726cd57e65db3e4fb57fb8572
const { isError, deprecate } = require('internal/util');

const errorCache = new SafeMap();
@@ -293,8 +294,16 @@ function getErrMessage(message, fn) {
@@ -294,8 +295,16 @@ function getErrMessage(message, fn) {
ErrorCaptureStackTrace(err, fn);
if (errorStackTraceLimitIsWritable) Error.stackTraceLimit = tmpLimit;

Expand All @@ -41,7 +41,7 @@ index b7d7a3da01d520984a5903cb9a0f1c288e0d5fa0..66a60c3726cd57e65db3e4fb57fb8572
+ Error.prepareStackTrace = tmpPrepare;
+ }

const filename = call.getFileName();
let filename = call.getFileName();
const line = call.getLineNumber() - 1;
diff --git a/src/api/environment.cc b/src/api/environment.cc
index c02906eacd90ac27d618e7578d1f928f16a858f7..74b4e15b8230c6380d41e84aa504824bb79b2ee5 100644
Expand Down

0 comments on commit e87b61b

Please sign in to comment.