Skip to content

Commit

Permalink
ensure System.set returns the namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Mar 3, 2019
1 parent 6b85a8c commit 2b9dd59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/features/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ systemJSPrototype.set = function (id, module) {
E: undefined,
C: done
};
return ns;
};

systemJSPrototype.has = function (id) {
Expand Down
3 changes: 2 additions & 1 deletion test/system-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ describe('Core API', function () {
});

it('Supports System.set', async function () {
loader.set('x', { y: 43 });
const _x = loader.set('x', { y: 43 });
const x = await loader.import('x');
assert.equal(x.y, 43);
assert.equal(x, _x);
});
});
});
Expand Down

0 comments on commit 2b9dd59

Please sign in to comment.