@@ -5,6 +5,7 @@ declare const unsafeWindow: unsafeWindow
55const Win = typeof unsafeWindow !== 'undefined' ? unsafeWindow : window
66
77const OriginalArrayToString = Win . Array . prototype . toString
8+ const OriginalRegExpTest = Win . RegExp . prototype . test
89
910const ProtectedFunctionStrings = [ 'toString' , 'get' , 'set' ]
1011
@@ -31,7 +32,7 @@ Win.Map.prototype.get = new Proxy(Win.Map.prototype.get, {
3132 }
3233
3334 let ArgText = OriginalArrayToString . call ( Args ) as string
34- if ( ASInitPositiveRegExps . filter ( ASInitPositiveRegExp => ASInitPositiveRegExp . filter ( Index => Index . test ( ArgText ) ) . length >= 2 ) . length === 1 ) {
35+ if ( ASInitPositiveRegExps . filter ( ASInitPositiveRegExp => ASInitPositiveRegExp . filter ( Index => OriginalRegExpTest . call ( Index , ArgText ) as boolean ) . length >= 2 ) . length === 1 ) {
3536 console . debug ( '[tinyShield]: Map.prototype.get:' , ThisArg , Args )
3637 throw new Error ( )
3738 }
@@ -51,7 +52,7 @@ Win.Map.prototype.set = new Proxy(Win.Map.prototype.set, {
5152 } catch {
5253 console . warn ( '[tinyShield]: Map.prototype.get:' , ThisArg , Args )
5354 }
54- if ( ASReinsertedAdvInvenPositiveRegExps . filter ( ASReinsertedAdvInvenPositiveRegExp => ASReinsertedAdvInvenPositiveRegExp . filter ( Index => Index . test ( ArgText ) ) . length >= 1 ) . length === 1 ) {
55+ if ( ASReinsertedAdvInvenPositiveRegExps . filter ( ASReinsertedAdvInvenPositiveRegExp => ASReinsertedAdvInvenPositiveRegExp . filter ( Index => OriginalRegExpTest . call ( Index , ArgText ) as boolean ) . length >= 1 ) . length === 1 ) {
5556 console . debug ( '[tinyShield]: Map.prototype.set:' , ThisArg , Args )
5657 throw new Error ( )
5758 }
0 commit comments