aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/builtins/js/BundlerPlugin.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-05-06 16:31:46 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-05-06 16:31:46 -0700
commit70e850bf76ee9e2124a95e865208aa6e63fa3538 (patch)
treedc3f2b97d191dc2ed08f8fb04f9d9ef2455630a6 /src/bun.js/builtins/js/BundlerPlugin.js
parentd4b35d9ae6709d5d20e270ad285291fa4ae9e950 (diff)
downloadbun-70e850bf76ee9e2124a95e865208aa6e63fa3538.tar.gz
bun-70e850bf76ee9e2124a95e865208aa6e63fa3538.tar.zst
bun-70e850bf76ee9e2124a95e865208aa6e63fa3538.zip
fix crash when there are lots of build errors
Diffstat (limited to 'src/bun.js/builtins/js/BundlerPlugin.js')
-rw-r--r--src/bun.js/builtins/js/BundlerPlugin.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bun.js/builtins/js/BundlerPlugin.js b/src/bun.js/builtins/js/BundlerPlugin.js
index 8e587794b..f580a1c05 100644
--- a/src/bun.js/builtins/js/BundlerPlugin.js
+++ b/src/bun.js/builtins/js/BundlerPlugin.js
@@ -53,7 +53,8 @@ function runOnResolvePlugins(
][kindId];
var promiseResult = (async (inputPath, inputNamespace, importer, kind) => {
- var results = this.onResolve.@get(inputNamespace);
+ var {onResolve, onLoad} = this;
+ var results = onResolve.@get(inputNamespace);
if (!results) {
this.onResolveAsync(internalID, null, null, null);
return null;
@@ -131,7 +132,7 @@ function runOnResolvePlugins(
if (userNamespace === "dataurl") {
if (!path.startsWith("data:")) {
@throwTypeError(
- 'onResolve plugin "path" must start with "data:" when the namespace is"dataurl"'
+ 'onResolve plugin "path" must start with "data:" when the namespace is "dataurl"'
);
}
}
@@ -399,7 +400,7 @@ function runOnLoadPlugins(internalID, path, namespace, defaultLoaderId) {
const chosenLoader = LOADERS_MAP[loader];
if (chosenLoader === @undefined) {
- @throwTypeError('Loader "' + loader + '" is not supported.');
+ @throwTypeError(`Loader ${@jsonStringify(loader, " ")} is not supported.`);
}
this.onLoadAsync(internalID, contents, chosenLoader);