fix: bundle loader returns exported value (#7764)

Fixes: #7761
This commit is contained in:
Kitson Kelly 2020-09-30 18:51:19 +10:00 committed by GitHub
parent 7c62b7b043
commit 23a7ea9c85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -44,14 +44,15 @@ let System, __instantiate;
function gE(exp) {
return (id, v) => {
v = typeof id === "string" ? { [id]: v } : id;
for (const [id, value] of Object.entries(v)) {
const e = typeof id === "string" ? { [id]: v } : id;
for (const [id, value] of Object.entries(e)) {
Object.defineProperty(exp, id, {
value,
writable: true,
enumerable: true,
});
}
return v;
};
}