aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/builtins/cpp/BundlerPluginBuiltins.cpp
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/cpp/BundlerPluginBuiltins.cpp
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/cpp/BundlerPluginBuiltins.cpp')
-rw-r--r--src/bun.js/builtins/cpp/BundlerPluginBuiltins.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/bun.js/builtins/cpp/BundlerPluginBuiltins.cpp b/src/bun.js/builtins/cpp/BundlerPluginBuiltins.cpp
index 1f2053ad5..552057d51 100644
--- a/src/bun.js/builtins/cpp/BundlerPluginBuiltins.cpp
+++ b/src/bun.js/builtins/cpp/BundlerPluginBuiltins.cpp
@@ -192,7 +192,7 @@ const char* const s_bundlerPluginRunOnResolvePluginsCode =
const JSC::ConstructAbility s_bundlerPluginRunSetupFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_bundlerPluginRunSetupFunctionCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_bundlerPluginRunSetupFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_bundlerPluginRunSetupFunctionCodeLength = 3262;
+const int s_bundlerPluginRunSetupFunctionCodeLength = 3786;
static const JSC::Intrinsic s_bundlerPluginRunSetupFunctionCodeIntrinsic = JSC::NoIntrinsic;
const char* const s_bundlerPluginRunSetupFunctionCode =
"(function (setup) {\n" \
@@ -248,6 +248,19 @@ const char* const s_bundlerPluginRunSetupFunctionCode =
" validate(filterObject, callback, onResolvePlugins);\n" \
" }\n" \
"\n" \
+ " function onStart(callback) {\n" \
+ " //\n" \
+ " @throwTypeError(\"On-start callbacks are not implemented yet. See https:/\\/github.com/oven-sh/bun/issues/2771\");\n" \
+ " }\n" \
+ "\n" \
+ " function onEnd(callback) {\n" \
+ " @throwTypeError(\"On-end callbacks are not implemented yet. See https:/\\/github.com/oven-sh/bun/issues/2771\");\n" \
+ " }\n" \
+ "\n" \
+ " function onDispose(callback) {\n" \
+ " @throwTypeError(\"On-dispose callbacks are not implemented yet. See https:/\\/github.com/oven-sh/bun/issues/2771\");\n" \
+ " }\n" \
+ "\n" \
" const processSetupResult = () => {\n" \
" var anyOnLoad = false,\n" \
" anyOnResolve = false;\n" \
@@ -277,7 +290,7 @@ const char* const s_bundlerPluginRunSetupFunctionCode =
" if (!existing) {\n" \
" onResolveObject.@set(namespace, callbacks);\n" \
" } else {\n" \
- " onResolveObject.@set(existing.concat(callbacks));\n" \
+ " onResolveObject.@set(namespace, existing.concat(callbacks));\n" \
" }\n" \
" }\n" \
" }\n" \
@@ -294,7 +307,7 @@ const char* const s_bundlerPluginRunSetupFunctionCode =
" if (!existing) {\n" \
" onLoadObject.@set(namespace, callbacks);\n" \
" } else {\n" \
- " onLoadObject.@set(existing.concat(callbacks));\n" \
+ " onLoadObject.@set(namespace, existing.concat(callbacks));\n" \
" }\n" \
" }\n" \
" }\n" \
@@ -304,8 +317,11 @@ const char* const s_bundlerPluginRunSetupFunctionCode =
" };\n" \
"\n" \
" var setupResult = setup({\n" \
+ " onDispose,\n" \
+ " onEnd,\n" \
" onLoad,\n" \
" onResolve,\n" \
+ " onStart,\n" \
" });\n" \
"\n" \
" if (setupResult && @isPromise(setupResult)) {\n" \