Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use plain method closure comparison for JS. #10553

Merged
merged 2 commits into from
Jan 15, 2022

Conversation

back2dos
Copy link
Member

Not too proud of duplicating the code from genjs. Perhaps it would be best to expose it via JSGenApi?

In any case, my main motivation is for Reflect.compareMethods not to use Reflect.isFunction, because that relies on __define_feature__ quite a bit, thus increasing output. I ran into this, because haxe.http.HttpBase uses Reflect.compareMethods (could be avoided, but I'd rather fix the underlying issue).

If anyone feels strongly about having the scope and method check around for some weird compatibility reasons, I can instead make a PR that checks the typeof to be "function" (instead of the full Reflect.isFunction), which should be good enough, because per spec "If f1 or f2 are not functions, the result is unspecified".

@skial skial mentioned this pull request Jan 13, 2022
1 task
@Simn
Copy link
Member

Simn commented Jan 15, 2022

I don't really understand what happens here because it's Javascript, but the tests are green so I'll just merge this and see if somebody complains.

@Simn Simn merged commit 5825e12 into HaxeFoundation:development Jan 15, 2022
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.

2 participants