forked from Moddable-OpenSource/moddable
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Patrick Soquet
committed
Jan 2, 2022
1 parent
03d3211
commit b815e62
Showing
3 changed files
with
30 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
import increment from "increment"; | ||
function test() { | ||
trace("app " + increment() + "\n"); | ||
} | ||
let compartment = new Compartment({}, { | ||
increment: "/increment.xsb", | ||
mod: "/mod.xsb", | ||
}, { | ||
resolveHook(specifier, refererSpecifier) { | ||
return specifier; | ||
}, | ||
loadNowHook(specifier) { | ||
return modules[specifier]; | ||
} | ||
import * as increment from "increment"; | ||
const mod = "mod" | ||
let compartment1 = new Compartment({}, { | ||
increment, | ||
mod | ||
}); | ||
let modNS = compartment.importNow("mod"); | ||
test(); | ||
modNS.test(); | ||
test(); | ||
modNS.test(); | ||
let compartment2 = new Compartment({}, { | ||
increment, | ||
mod | ||
}); | ||
|
||
let modNS1 = compartment1.importNow("mod") | ||
let modNS2 = compartment2.importNow("mod") | ||
|
||
modNS1.test(); | ||
modNS2.test(); | ||
modNS1.test(); | ||
modNS2.test(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters