mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 13:22:07 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -108,8 +108,7 @@ bool BundlerPlugin::anyMatchesCrossThread(JSC::VM& vm, const BunString* namespac
|
||||
// Check virtual modules for both onLoad and onResolve (only in "file" namespace)
|
||||
if (!this->virtualModules.isEmpty()) {
|
||||
// Virtual modules only work in the "file" namespace or empty namespace (defaults to "file")
|
||||
bool isFileNamespace = !namespaceStr || namespaceStr->isEmpty() ||
|
||||
namespaceStr->toWTFString(BunString::ZeroCopy) == "file"_s;
|
||||
bool isFileNamespace = !namespaceStr || namespaceStr->isEmpty() || namespaceStr->toWTFString(BunString::ZeroCopy) == "file"_s;
|
||||
if (isFileNamespace && this->virtualModules.contains(pathString)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ export function runOnResolvePlugins(this: BundlerPlugin, specifier, inputNamespa
|
||||
}
|
||||
|
||||
var results = onResolve.$get(inputNamespace);
|
||||
|
||||
|
||||
if (!results) {
|
||||
this.onResolveAsync(internalID, null, null, null);
|
||||
return null;
|
||||
@@ -595,7 +595,9 @@ export function runOnLoadPlugins(
|
||||
contents = JSON.stringify(result.exports);
|
||||
loader = "json";
|
||||
} catch (e) {
|
||||
throw new TypeError("Virtual module must return a JSON-serializable object when using loader: \"object\": " + e);
|
||||
throw new TypeError(
|
||||
'Virtual module must return a JSON-serializable object when using loader: "object": ' + e,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user