diff options
| author | Kitson Kelly <me@kitsonkelly.com> | 2019-11-21 03:02:08 +1100 |
|---|---|---|
| committer | Ry Dahl <ry@tinyclouds.org> | 2019-11-20 11:02:08 -0500 |
| commit | 8d977d0117c2b61e6714cec9e4238f4ba0a56195 (patch) | |
| tree | 5992f83fa50067f59aec1f1c9008d6c3fe6e921d /deno_typescript/bundle_loader.js | |
| parent | 1912ed674097588adb7b83e7b78043b2168821f3 (diff) | |
feat: Support named exports on bundles. (#3352)
Diffstat (limited to 'deno_typescript/bundle_loader.js')
| -rw-r--r-- | deno_typescript/bundle_loader.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/deno_typescript/bundle_loader.js b/deno_typescript/bundle_loader.js index 682754628..c56e8c0cb 100644 --- a/deno_typescript/bundle_loader.js +++ b/deno_typescript/bundle_loader.js @@ -6,14 +6,16 @@ // bundles when creating snapshots, but is also used when emitting bundles from // Deno cli. +// @ts-nocheck + /** - * @type {(name: string, deps: ReadonlyArray<string>, factory: (...deps: any[]) => void) => void} + * @type {(name: string, deps: ReadonlyArray<string>, factory: (...deps: any[]) => void) => void=} */ // eslint-disable-next-line @typescript-eslint/no-unused-vars let define; /** - * @type {(mod: string | string[]) => void} + * @type {(mod: string) => any=} */ // eslint-disable-next-line @typescript-eslint/no-unused-vars let instantiate; @@ -111,14 +113,9 @@ let instantiate; instantiate = dep => { define = undefined; - if (Array.isArray(dep)) { - for (const d of dep) { - getExports(d); - } - } else { - getExports(dep); - } + const result = getExports(dep); // clean up, or otherwise these end up in the runtime environment instantiate = undefined; + return result; }; })(); |
