Skip to content

Commit

Permalink
Add CodeQL comments (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima authored Jun 21, 2023
1 parent 15c6965 commit 7c0dfb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/scriptLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ namespace AMDLoader {
const func = (
trustedTypesPolicy
? self.eval(trustedTypesPolicy.createScript('', 'true'))
: new Function('true')
: new Function('true') // CodeQL [SM01632] the loader is responsible with loading code, fetch + eval is used on the web worker instead of importScripts if possible because importScripts is synchronous and we observed deadlocks on Safari
);
func.call(self);
return true;
Expand Down Expand Up @@ -226,7 +226,7 @@ namespace AMDLoader {
const func = (
trustedTypesPolicy
? self.eval(trustedTypesPolicy.createScript('', text))
: new Function(text)
: new Function(text) // CodeQL [SM01632] the loader is responsible with loading code, fetch + eval is used on the web worker instead of importScripts if possible because importScripts is synchronous and we observed deadlocks on Safari
);
func.call(self);
callback();
Expand Down
6 changes: 4 additions & 2 deletions src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ var AMDLoader;
try {
const func = (trustedTypesPolicy
? self.eval(trustedTypesPolicy.createScript('', 'true'))
: new Function('true'));
: new Function('true') // CodeQL [SM01632] the loader is responsible with loading code, fetch + eval is used on the web worker instead of importScripts if possible because importScripts is synchronous and we observed deadlocks on Safari
);
func.call(self);
return true;
}
Expand Down Expand Up @@ -705,7 +706,8 @@ var AMDLoader;
text = `${text}\n//# sourceURL=${scriptSrc}`;
const func = (trustedTypesPolicy
? self.eval(trustedTypesPolicy.createScript('', text))
: new Function(text));
: new Function(text) // CodeQL [SM01632] the loader is responsible with loading code, fetch + eval is used on the web worker instead of importScripts if possible because importScripts is synchronous and we observed deadlocks on Safari
);
func.call(self);
callback();
}).then(undefined, errorback);
Expand Down

0 comments on commit 7c0dfb6

Please sign in to comment.