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

Commit c0f66ad

Browse files
committed
implement bulk export variation
1 parent 8b75ac1 commit c0f66ad

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/declarative.js

+14-5
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,24 @@
134134
// By disaling this module write-protection we gain performance.
135135
// It could be useful to allow an option to enable or disable this.
136136
module.locked = true;
137-
moduleObj[name] = value;
137+
138+
// export({name: value})
139+
if (typeof name == 'object') {
140+
for (var p in name)
141+
moduleObj[p] = name[p];
142+
}
143+
// export(name, value)
144+
else {
145+
moduleObj[name] = value;
146+
}
138147

139148
for (var i = 0, l = module.importers.length; i < l; i++) {
140149
var importerModule = module.importers[i];
141150
if (!importerModule.locked) {
142-
for (var j = 0; j < importerModule.dependencies.length; ++j) {
143-
if (importerModule.dependencies[j] === module) {
144-
importerModule.setters[j](moduleObj);
145-
}
151+
for (var j = 0; j < importerModule.dependencies.length; ++j) {
152+
if (importerModule.dependencies[j] === module) {
153+
importerModule.setters[j](moduleObj);
154+
}
146155
}
147156
}
148157
}

0 commit comments

Comments
 (0)