From 2b9dd595dac2721ecde90dad2f27488155d64efd Mon Sep 17 00:00:00 2001
From: Guy Bedford
Date: Sun, 3 Mar 2019 19:16:32 +0200
Subject: [PATCH] ensure System.set returns the namespace
---
src/features/registry.js | 1 +
test/system-core.js | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/features/registry.js b/src/features/registry.js
index 079c42eac..2b436abfa 100644
--- a/src/features/registry.js
+++ b/src/features/registry.js
@@ -36,6 +36,7 @@ systemJSPrototype.set = function (id, module) {
E: undefined,
C: done
};
+ return ns;
};
systemJSPrototype.has = function (id) {
diff --git a/test/system-core.js b/test/system-core.js
index 31eb063cd..43f57fb81 100644
--- a/test/system-core.js
+++ b/test/system-core.js
@@ -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);
});
});
});