Use assertNativeFunction instead of simple regexp pattern

This commit is contained in:
Sosuke Suzuki 2025-04-26 13:48:11 +09:00 committed by Ms2ger
parent ac9ff9bf75
commit 27622d7647

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js]
includes: [sm/non262.js, sm/non262-shell.js, nativeFunctionMatcher.js]
flags:
- noStrict
description: |
@ -261,9 +261,7 @@ function testBound(fun)
testBound(strict);
testBound(nonstrict);
var nativeFunctionRegex = /^function\s*\(\)\s*\{\s*\[native code\]\s*\}$/
assert.sameValue(nativeFunctionRegex.test((function unbound(){"body"}).bind().toString()), true);
assertNativeFunction((function unbound(){"body"}).bind());
/* 22. Return F. */
var passim = function p(){}.bind(1);