File: fix-node-20-prepareStackTrace.patch

package info (click to toggle)
coffeescript 2.7.0%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,376 kB
  • sloc: makefile: 20; xml: 9; javascript: 5; sh: 1
file content (26 lines) | stat: -rw-r--r-- 1,056 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Node 20 has non null Error.prepareStackTrace
 this fix just checks that its function name is the right one. It is a weak test.
Forwarded: not-needed, project is somewhat abandoned
Author: Jérémy Lal <kapouer@melix.org>
--- a/src/register.coffee
+++ b/src/register.coffee
@@ -11,7 +11,7 @@
   process.env.NODE_OPTIONS?.includes('--enable-source-maps')
 )
 
-unless Error.prepareStackTrace or nodeSourceMapsSupportEnabled
+unless Error.prepareStackTrace and Error.prepareStackTrace.name != 'ErrorPrepareStackTrace' or nodeSourceMapsSupportEnabled
   cacheSourceMaps = true
   patchStackTrace()
 
--- a/test/sourcemap.coffee
+++ b/test/sourcemap.coffee
@@ -167,7 +167,7 @@
     proc = spawn 'node', [
       '--eval', """
         require('./lib/coffeescript/coffeescript.js');
-        process.stdout.write(Error.prepareStackTrace === undefined ? 'unused' : 'defined');
+        process.stdout.write(Error.prepareStackTrace === undefined || Error.prepareStackTrace.name == "ErrorPrepareStackTrace" ? 'unused' : 'defined');
       """
     ]