fix: improve test regex to validate disallowed methods that can be bypassed by prototype reassignments and/or otherwise (#38214)

* fix: improve test regex to validate disallowed methods that can be bypassed by prototype reassignments and/or otherwise

* fix: fixing regex pattern
This commit is contained in:
Hassaan Pasha
2020-03-26 20:13:34 +05:00
committed by GitHub
parent bb7a50e341
commit 4fbce07792
13 changed files with 18 additions and 16 deletions

View File

@ -24,7 +24,7 @@ tests:
- text: <code>result</code> should equal to <code>"Hello, World!"</code>
testString: assert(result == "Hello, World!");
- text: Your solution should not use the <code>String.prototype.trim()</code> method.
testString: assert(!code.match(/\.trim\([\s\S]*?\)/));
testString: assert(!code.match(/\.?[\s\S]*?trim/));
- text: The <code>result</code> variable should not be set equal to a string.
testString: assert(!code.match(/result\s*=\s*".*?"/));