@webqit/oohtml 1.10.1-0 → 1.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "wicg-proposal"
15
15
  ],
16
16
  "homepage": "https://webqit.io/tooling/oohtml",
17
- "version": "1.10.1-0",
17
+ "version": "1.10.3",
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
@@ -372,7 +372,7 @@ export default function init( _config = {} ) {
372
372
  Object.defineProperty(document, 'templatesReadyState', { get: () => templatesReadyState });
373
373
  WebQit.DOM.ready.call(WebQit, () => {
374
374
  loadingTemplates.forEach(promise => {
375
- promise.catch(error => {
375
+ promise && promise.catch(error => {
376
376
  console.warn(error);
377
377
  });
378
378
  });
package/src/util.js CHANGED
@@ -114,9 +114,6 @@ const evalModuleExpr = (contexts, segment, collectionCallback) => {
114
114
  var [ _reference, modifiers ] = parseScopeReferenceExpr(_reference);
115
115
  // ------------
116
116
  return contexts.reduce((list, context) => {
117
- if (_internals(context, 'oohtml').has('queryCallback')) {
118
- _internals(context, 'oohtml').get('queryCallback')();
119
- }
120
117
  var collection = collectionCallback(context);
121
118
  if (_reference === '*') {
122
119
  _reference = '(' + collection.keys().join('+') + ')';
@@ -154,20 +151,25 @@ const execScopeQuery = function(contexts, path, collectionCallback, advancementC
154
151
  return [];
155
152
  }
156
153
 
157
- var segment = path.shift(), isStopSegmentIfCount;
154
+ let segment = path.shift(), isStopSegmentIfCount;
158
155
  if (segment.endsWith('.')) {
159
156
  isStopSegmentIfCount = true;
160
157
  segment = segment.substr(0, segment.length - 1).trim();
161
158
  }
162
159
  // -----------
163
- var modules = evalModuleExpr(contexts, segment, collectionCallback);
160
+ let modules = evalModuleExpr(contexts, segment, collectionCallback);
161
+ modules.forEach(context => {
162
+ if (_internals(context, 'oohtml').has('queryCallback')) {
163
+ _internals(context, 'oohtml').get('queryCallback')();
164
+ }
165
+ });
164
166
  // -----------
165
167
  if (modules.length && isStopSegmentIfCount) {
166
168
  return modules;
167
169
  }
168
170
  // -----------
169
171
  if (path.length) {
170
- var submodules = execScopeQuery(modules, path.slice(), collectionCallback, advancementCallback, level + 1);
172
+ let submodules = execScopeQuery(modules, path.slice(), collectionCallback, advancementCallback, level + 1);
171
173
  if (submodules === -1) {
172
174
  return advancementCallback(modules, level, true);
173
175
  }