File: allow_amaro_external_builtin.patch

package info (click to toggle)
nodejs 24.11.1%2Bdfsg%2B~cs24.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 252,928 kB
  • sloc: cpp: 1,728,964; javascript: 473,397; ansic: 113,512; python: 60,329; sh: 4,344; makefile: 3,026; asm: 1,728; pascal: 1,562; perl: 494; lisp: 222; xml: 39
file content (31 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (3)
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
27
28
29
30
31
Description: process.versions.amaro is empty when loading it from external builtin
 So just try to load it to know if it's loadable.
Forwarded: not-needed
Last-Update: 2025-03-19
Author: Jérémy Lal <kapouer@melix.org>
--- a/lib/internal/modules/typescript.js
+++ b/lib/internal/modules/typescript.js
@@ -15,6 +15,7 @@
         isUnderNodeModules,
         kEmptyObject } = require('internal/util');
 const {
+	ERR_NO_TYPESCRIPT,
   ERR_INVALID_TYPESCRIPT_SYNTAX,
   ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING,
   ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX,
@@ -38,9 +39,12 @@
  * @returns {Function} The TypeScript parser function.
  */
 const loadTypeScriptParser = getLazy(() => {
-  assertTypeScript();
-  const amaro = require('internal/deps/amaro/dist/index');
-  return amaro.transformSync;
+	try {
+  	const amaro = require('internal/deps/amaro/dist/index');
+  	return amaro.transformSync;
+	} catch {
+		throw new ERR_NO_TYPESCRIPT();
+	}
 });
 
 /**