aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/builtins/js
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-04-29 00:08:48 -0400
committerGravatar GitHub <noreply@github.com> 2023-04-28 21:08:48 -0700
commit96e113f41c0dae1ccd58c6d1e3b6dd2c54769636 (patch)
tree1f8c0b88d2daa925abff610f4a458d744bc0bf36 /src/bun.js/builtins/js
parentbc0c0f7d203567a5538f271a3bc37c450eeaee46 (diff)
downloadbun-96e113f41c0dae1ccd58c6d1e3b6dd2c54769636.tar.gz
bun-96e113f41c0dae1ccd58c6d1e3b6dd2c54769636.tar.zst
bun-96e113f41c0dae1ccd58c6d1e3b6dd2c54769636.zip
bundler tests: rest of default.test.ts and starting jsx tests (#2765)
Diffstat (limited to 'src/bun.js/builtins/js')
-rw-r--r--src/bun.js/builtins/js/BundlerPlugin.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/bun.js/builtins/js/BundlerPlugin.js b/src/bun.js/builtins/js/BundlerPlugin.js
index 9fbb323ed..4daa2dcbb 100644
--- a/src/bun.js/builtins/js/BundlerPlugin.js
+++ b/src/bun.js/builtins/js/BundlerPlugin.js
@@ -221,6 +221,19 @@ function runSetupFunction(setup) {
validate(filterObject, callback, onResolvePlugins);
}
+ function onStart(callback) {
+ // builtin generator thinks the // in the link is a comment and removes it
+ @throwTypeError("On-start callbacks are not implemented yet. See https:/\/github.com/oven-sh/bun/issues/2771");
+ }
+
+ function onEnd(callback) {
+ @throwTypeError("On-end callbacks are not implemented yet. See https:/\/github.com/oven-sh/bun/issues/2771");
+ }
+
+ function onDispose(callback) {
+ @throwTypeError("On-dispose callbacks are not implemented yet. See https:/\/github.com/oven-sh/bun/issues/2771");
+ }
+
const processSetupResult = () => {
var anyOnLoad = false,
anyOnResolve = false;
@@ -250,7 +263,7 @@ function runSetupFunction(setup) {
if (!existing) {
onResolveObject.@set(namespace, callbacks);
} else {
- onResolveObject.@set(existing.concat(callbacks));
+ onResolveObject.@set(namespace, existing.concat(callbacks));
}
}
}
@@ -267,7 +280,7 @@ function runSetupFunction(setup) {
if (!existing) {
onLoadObject.@set(namespace, callbacks);
} else {
- onLoadObject.@set(existing.concat(callbacks));
+ onLoadObject.@set(namespace, existing.concat(callbacks));
}
}
}
@@ -277,8 +290,11 @@ function runSetupFunction(setup) {
};
var setupResult = setup({
+ onDispose,
+ onEnd,
onLoad,
onResolve,
+ onStart,
});
if (setupResult && @isPromise(setupResult)) {