Skip to content

Use assertNativeFunction instead of simple regexp pattern#4462

Merged
Ms2ger merged 1 commit intotc39:mainfrom
sosukesuzuki:sm-function-bind-assertNativeFunction
Apr 29, 2025
Merged

Use assertNativeFunction instead of simple regexp pattern#4462
Ms2ger merged 1 commit intotc39:mainfrom
sosukesuzuki:sm-function-bind-assertNativeFunction

Conversation

@sosukesuzuki
Copy link
Contributor

test/staging/sm/Function/function-bind.js test is using a regexp pattern /^function\s*\(\)\s*\{\s*\[native code\]\s*\}$/ for checking native functions.

That regexp pattern doesn't match JSC's output( JSC's Function#toString output includes indentation ).

So this patch changes to use assertNativeFunction.

@sosukesuzuki sosukesuzuki marked this pull request as ready for review April 26, 2025 04:51
@sosukesuzuki sosukesuzuki requested review from a team as code owners April 26, 2025 04:51
Copy link
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ptomato
Copy link
Contributor

ptomato commented Apr 28, 2025

Not sure why the esmeta failure. I wonder if the same test failed on esmeta before the change.

@Ms2ger Ms2ger force-pushed the sm-function-bind-assertNativeFunction branch from 2229fe1 to 45c6f70 Compare April 29, 2025 11:55
@Ms2ger Ms2ger enabled auto-merge (rebase) April 29, 2025 11:57
@Ms2ger Ms2ger merged commit 27622d7 into tc39:main Apr 29, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants