Fix hasty last commit

This commit is contained in:
Raymond Hill 2021-07-17 14:27:37 -04:00
parent 36f82b8a5a
commit f07b1475a3
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 2 additions and 3 deletions

View File

@ -41,7 +41,7 @@
if ( target === '' || target === '{{1}}' ) { return; }
const reRegexEscape = /[.*+?^${}()|[\]\\]/g;
const needle = '{{2}}';
const reText = (( ) => {
const reNeedle = (( ) => {
if ( needle === '' || needle === '{{2}}' ) { return /^/; }
if ( /^\/.+\/$/.test(needle) ) {
return new RegExp(needle.slice(1,-1));
@ -57,7 +57,6 @@
return new RegExp(context.replace(reRegexEscape, '\\$&'));
})();
const thisScript = document.currentScript;
const re = new RegExp(reText);
const chain = target.split('.');
let owner = window;
let prop;
@ -84,7 +83,7 @@
e instanceof HTMLScriptElement &&
reContext.test(e.src) &&
e !== thisScript &&
re.test(e.textContent)
reNeedle.test(e.textContent)
) {
throw new ReferenceError(magic);
}