@@ -32,7 +32,7 @@ const worldTemplate = {
3232 scriptletFunctions : new Map ( ) ,
3333 allFunctions : new Map ( ) ,
3434 args : new Map ( ) ,
35- arglists : new Map ( ) ,
35+ arglists : new Map ( [ [ '' , 0 ] ] ) ,
3636 hostnames : new Map ( ) ,
3737 regexesOrPaths : new Map ( ) ,
3838 matches : new Set ( ) ,
@@ -64,6 +64,29 @@ function createScriptletCoreCode(worldDetails, resourceEntry) {
6464
6565/******************************************************************************/
6666
67+ function compileBroadExclusion ( details ) {
68+ if ( Boolean ( details . excludeMatches ?. length ) === false ) { return ; }
69+ for ( const worldDetails of Object . values ( worlds ) ) {
70+ for ( const hn of details . excludeMatches ) {
71+ if ( isHnRegexOrPath ( hn ) ) {
72+ const refs = worldDetails . regexesOrPaths . get ( hn ) ?? new Set ( ) ;
73+ if ( refs . size === 0 ) {
74+ worldDetails . regexesOrPaths . set ( hn , refs ) ;
75+ }
76+ refs . add ( 0 ) ;
77+ continue ;
78+ }
79+ const refs = worldDetails . hostnames . get ( hn ) ?? new Set ( ) ;
80+ if ( refs . size === 0 ) {
81+ worldDetails . hostnames . set ( hn , refs ) ;
82+ }
83+ refs . add ( 0 ) ;
84+ }
85+ }
86+ }
87+
88+ /******************************************************************************/
89+
6790export function reset ( ) {
6891 worlds . ISOLATED = structuredClone ( worldTemplate ) ;
6992 worlds . MAIN = structuredClone ( worldTemplate ) ;
@@ -72,6 +95,9 @@ export function reset() {
7295/******************************************************************************/
7396
7497export function compile ( rulesetId , details ) {
98+ if ( details . args . length === 0 ) {
99+ return compileBroadExclusion ( details ) ;
100+ }
75101 if ( details . args [ 0 ] . endsWith ( '.js' ) === false ) {
76102 details . args [ 0 ] += '.js' ;
77103 }
0 commit comments