From 34b0db5fb0da6beccd4a8d870d7bd4891721080c Mon Sep 17 00:00:00 2001 From: Lucas Mirelmann Date: Fri, 18 Apr 2025 19:59:02 +0200 Subject: [PATCH] Escape syntax character in regex Syntax characters need to be escaped when they are part of a regex. https://tc39.es/ecma262/#prod-Atom https://tc39.es/ecma262/#prod-PatternCharacter --- test/staging/sm/Function/function-bind.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/staging/sm/Function/function-bind.js b/test/staging/sm/Function/function-bind.js index 6c023f0591..b86eca1d55 100644 --- a/test/staging/sm/Function/function-bind.js +++ b/test/staging/sm/Function/function-bind.js @@ -261,7 +261,7 @@ function testBound(fun) testBound(strict); testBound(nonstrict); -var nativeFunctionRegex = /^function\s*\(\)\s*{\s*\[native code\]\s*}$/ +var nativeFunctionRegex = /^function\s*\(\)\s*\{\s*\[native code\]\s*\}$/ assert.sameValue(nativeFunctionRegex.test((function unbound(){"body"}).bind().toString()), true);