Skip to content

Commit

Permalink
fix bug where UMD modules with further dependencies did not resolve c…
Browse files Browse the repository at this point in the history
…orrectly
  • Loading branch information
dlueth committed Oct 4, 2020
1 parent cdcd82f commit 0c4cbb1
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dist/cache/dispose.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cache/states.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/demand.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/demand.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/handler/css.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/html.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/json.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/legacy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/handler/text.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/cookie.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/lzstring.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugin/sri.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qoopido.demand",
"title": "Qoopido.demand",
"description": "Promise like module loader using XHR requests and localStorage caching to dynamically load JavaScript and CSS + dynamic dependency resolution + support for custom handlers",
"version": "7.1.4",
"version": "7.1.5",
"homepage": "https://github.com/dlueth/qoopido.demand",
"author": {
"name": "Dirk Lueth",
Expand Down
5 changes: 1 addition & 4 deletions src/class/dependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ var ClassDependency = (function() {

break;
case EXPORTS_ID:
value = {};

dependency.dfd.pledge
.then(this.get(context).dfd.resolve);
value = this.get(context).value = {};

break;
}
Expand Down
5 changes: 3 additions & 2 deletions src/function/provide.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ provide = function provide() {
try {
value = definition.apply(NULL, arguments);

if(validatorIsThenable(value)) {
// module.value is already set when when module used exports (e.g. UMD)
if(!module.value && validatorIsThenable(value)) {
value
.then(
module.dfd.resolve,
function() { module.dfd.reject(new ClassFailure(ERROR_PROVIDE, module.id, arguments)); }
);
} else {
module.dfd.resolve(value);
module.dfd.resolve(module.value || value);
}
} catch(error) {
module.dfd.reject(new ClassFailure(ERROR_PROVIDE, module.id, arguments));
Expand Down

0 comments on commit 0c4cbb1

Please sign in to comment.