mirror of
https://github.com/morluto/rea.git
synced 2026-11-22 14:35:45 +00:00
fix(javascript): select JSON and addon loaders by exact suffix (#7821)
Node's CommonJS loader matches registered extensions case-sensitively, so
require("./data.JSON") and require("./addon.NODE") run as JavaScript.
Derive target_json_status and the native loads relation from the exact
loader suffix instead of the inventory's case-folded file kind.
Fixes #7623
This commit is contained in:
4 files changed
+70
-6
No files matched your search
@@ -36,6 +36,7 @@ import {
|
||||
import {
|
||||
moduleResolutionModeForJavaScriptReference,
|
||||
isJsonModuleTarget,
|
||||
isNativeAddonModuleTarget,
|
||||
} from "../../domain/javascript/javascriptModuleResolutionMode.js";
|
||||
|
||||
type StaticReference = JavaScriptStaticAnalysis["references"][number];
|
||||
@@ -309,7 +310,8 @@ const addReference = (
|
||||
coverage: input.coverage,
|
||||
relation:
|
||||
input.value.operation === "load" &&
|
||||
resolved?.file?.kind === "native-addon"
|
||||
resolved?.path != null &&
|
||||
isNativeAddonModuleTarget(resolved.path, resolved.file?.kind)
|
||||
? "loads"
|
||||
: "imports",
|
||||
properties: {
|
||||
|
||||
Reference in new issue
Block a user