Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit 23e92dc

Browse files
committed
module toString is "Module"
1 parent e36fa26 commit 23e92dc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/loader.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
*/
2020

2121
function Module() {}
22+
// http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag
23+
defineProperty(Module.prototype, 'toString', {
24+
value: function() {
25+
return 'Module';
26+
}
27+
});
2228
function Loader(options) {
2329
this._loader = {
2430
loaderObj: this,

test/system.normalize.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
//
22

33
describe('System', function () {
4+
5+
describe('#toString', function() {
6+
it('Module toString is "Module"', function() {
7+
expect(System.newModule({}).toString()).to.equal('Module');
8+
});
9+
});
10+
411
describe('#normalize', function () {
512

613
describe('when having no argument', function () {

0 commit comments

Comments
 (0)