-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: Add support for methods with same name and different parameters #1013
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mbektchiev
suggested changes
Oct 31, 2018
test |
test --performance |
mbektchiev
reviewed
Nov 5, 2018
mbektchiev
reviewed
Nov 5, 2018
6200475
to
bc8d308
Compare
mbektchiev
reviewed
Nov 6, 2018
mbektchiev
reviewed
Nov 16, 2018
mbektchiev
reviewed
Nov 16, 2018
mbektchiev
reviewed
Nov 16, 2018
test |
73cc2bd
to
8c8172f
Compare
a0eb1bc
to
df6103a
Compare
*override subspaceFor() method from all JSInternalFunction subclasses (i.e. new FunctionWrapper and derived classes) *resolve conflicts
test |
test |
…ading-protocol-methods-issue Tdermendzhiev/wip f overloading protocol methods issue
test |
mbektchiev
approved these changes
Dec 21, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A single FFICall (JSFunction) now holds a reference to a bucket of functions instead of the 1:1 FFICall - ObjCMethod we used to have. Depending on the parameters passed to the call we now decide runtime which method to invoke.|
A question worth asking is won't it be better if we swap the names of FFICall and FunctionWrapper because it would make more sense for the FunctionWrapper to have a vector of FFICalls (each FFICall with it's cif) instead of the contrary.
PR Checklist
What is the current behavior?
In Objective-C two methods with the same name but with different set of parameters would have different selectors (e.g. "baseMethod" and "baseMethod:") but they will still have the same jsName (which we call from js - e.g. "baseMethod" and "baseMethod"). Because of the 1:1 mapping of the FFICall and the ObjC method we are able to call only one of the methods.
What is the new behavior?
A check for the parameters is added so we know exactly which method to call runtime.
Implements #877 .