diff options
author | 2023-09-22 01:09:55 -0400 | |
---|---|---|
committer | 2023-09-21 22:09:55 -0700 | |
commit | 25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a (patch) | |
tree | adf1d5e53f27a2f4ca7b2074fbd54e2c67764a74 /src/js/builtins/Module.ts | |
parent | 9d5459221ff663b6c0058440167e098886d97cc2 (diff) | |
download | bun-25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a.tar.gz bun-25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a.tar.zst bun-25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a.zip |
Implement module.parent (#5889)bun-v1.0.3
* Make module.parent work
* yay
* oops
* yay
Diffstat (limited to 'src/js/builtins/Module.ts')
-rw-r--r-- | src/js/builtins/Module.ts | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/js/builtins/Module.ts b/src/js/builtins/Module.ts index aa08bc728..3d88f2484 100644 --- a/src/js/builtins/Module.ts +++ b/src/js/builtins/Module.ts @@ -1,15 +1,3 @@ -interface CommonJSModuleRecord { - $require(id: string, mod: any): any; - children: CommonJSModuleRecord[]; - exports: any; - id: string; - loaded: boolean; - parent: undefined; - path: string; - paths: string[]; - require: typeof require; -} - $getter; export function main() { return $requireMap.$get(Bun.main); @@ -45,7 +33,7 @@ export function require(this: CommonJSModuleRecord, id: string) { // To handle import/export cycles, we need to create a module object and put // it into the map before we import it. - const mod = $createCommonJSModule(id, {}, false); + const mod = $createCommonJSModule(id, {}, false, this); $requireMap.$set(id, mod); // This is where we load the module. We will see if Module._load and |