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:
@ -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*".*?"/));
|
||||
|
||||
|
Reference in New Issue
Block a user