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

@V8Function can't handle 'get( id )' methods #117

Closed
stephan-ansems opened this issue Nov 30, 2021 · 1 comment
Closed

@V8Function can't handle 'get( id )' methods #117

stephan-ansems opened this issue Nov 30, 2021 · 1 comment

Comments

@stephan-ansems
Copy link

stephan-ansems commented Nov 30, 2021

Hello again,

Lets assume that some class Registry:

public class Registry {
  @V8Function
  public function Entry get( String key ) {
    System.out.println( "call to Register.get( '"+key+"')" );
    // magic implementation
  } 

  // ...etc...
}

Then somewhere else in the code this happens:

  // Create the registry and bind it to the runtime...
  Register registry = new Registry();
  try (V8ValueObject object = runtime.createV8ValueObject()) {
    result = runtime.getGlobalObject().set( "registry", registry );
    object.bind(registry);
  }

Executing the following runtime.getExecutor("registry.get( 'some-key' );").executeString(); yields the following (unexpected) output:

call to Register.get( 'get' );
call to Register.get( 'some-key' );

I think that the problem is that the method name (Registry.get) somehow conflicts with the internal pattern matching logic of Javet.

@stephan-ansems
Copy link
Author

Sorry, the issue seemed to be something else entirely... but still an issue

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

No branches or pull requests

1 participant