jsf.js_next_gen 4.0.0-beta-12 → 4.0.0-beta-14

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.
@@ -1190,14 +1190,14 @@ class DomQuery {
1190
1190
  * defaults to the standard jsf.js exclusion (we use this code for myfaces)
1191
1191
  */
1192
1192
  runScripts(whilteListed = DEFAULT_WHITELIST) {
1193
- const evalCollectedScripts = (finalScripts) => {
1194
- if (finalScripts.length) {
1193
+ const evalCollectedScripts = (scriptsToProcess) => {
1194
+ if (scriptsToProcess.length) {
1195
1195
  //script source means we have to eval the existing
1196
1196
  //scripts before running the include
1197
1197
  //this.globalEval(finalScripts.join("\n"));
1198
1198
  let joinedScripts = [];
1199
- Stream_1.Stream.of(...finalScripts).each(item => {
1200
- if (item.nonce == 'evalText') {
1199
+ Stream_1.Stream.of(...scriptsToProcess).each(item => {
1200
+ if (!item.nonce) {
1201
1201
  joinedScripts.push(item.evalText);
1202
1202
  }
1203
1203
  else {
@@ -1212,8 +1212,9 @@ class DomQuery {
1212
1212
  this.globalEval(joinedScripts.join("\n"));
1213
1213
  joinedScripts.length = 0;
1214
1214
  }
1215
- finalScripts = [];
1215
+ scriptsToProcess = [];
1216
1216
  }
1217
+ return scriptsToProcess;
1217
1218
  };
1218
1219
  let finalScripts = [], equi = equalsIgnoreCase, execScrpt = (item) => {
1219
1220
  var _a, _b, _c;
@@ -1233,8 +1234,9 @@ class DomQuery {
1233
1234
  //due to changing the and order instead of relying on left to right
1234
1235
  //if jsf.js is already registered we do not replace it anymore
1235
1236
  if (whilteListed(src)) {
1236
- evalCollectedScripts(finalScripts);
1237
- nonce != '' ? this.loadScriptEval(src, 0, "UTF-8", nonce) :
1237
+ //we run the collected scripts before running, the include
1238
+ finalScripts = evalCollectedScripts(finalScripts);
1239
+ (!!nonce) ? this.loadScriptEval(src, 0, "UTF-8", nonce) :
1238
1240
  //if no nonce is set we do not pass any once
1239
1241
  this.loadScriptEval(src, 0, "UTF-8");
1240
1242
  }
Binary file
Binary file