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

Enable to call default method on java8 #169

Closed
wants to merge 1 commit into from
Closed

Enable to call default method on java8 #169

wants to merge 1 commit into from

Conversation

tuchida
Copy link
Contributor

@tuchida tuchida commented Apr 7, 2015

When call Predicate#negate (default method) in java8.
https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html#negate--

var p = java.util.function.Predicate({
  test: function(t) {
    return true;
  }
}).negate();
p; // null

By right, the method return Predicate's instance, but returned null.
The negate method is generated from JavaAdapter in Rhino, and that body is empty.

So I made this:

  • Do not generate default method in JavaAdapter.
  • Add default method to JavaMember.

@gbrail
Copy link
Collaborator

gbrail commented Apr 13, 2015

Thanks -- I get this, and I think that's a good way to handle it.

However, I'd like to publish 1.7.6 soon, and I think that changing the build process so that 1.8 is required to build it is a bit of a big deal -- I'd rather push that out until 1.8.0. (I'd also like to change the build process so that we can use InvokeDynamic optionally at runtime, so that's a good time to do that as well.)

@tuchida
Copy link
Contributor Author

tuchida commented Apr 14, 2015

Thanks.

we can use InvokeDynamic optionally at runtime

Sounds good!

@eshepelyuk
Copy link
Contributor

@gbrail could you share usage scenarios for InvokeDynamic ?

@gbrail gbrail added this to the Release 1.7.8 milestone Jun 17, 2015
@gbrail
Copy link
Collaborator

gbrail commented Sep 28, 2017

I merged this in a different PR -- things have changed but it's still valid. Take a look at #340.

@gbrail
Copy link
Collaborator

gbrail commented Oct 2, 2017

Fixed this in #343.

@gbrail gbrail closed this Oct 2, 2017
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