vert-x3 / vertx-lang-js

Nashorn JavaScript implementation for Vert.x
Apache License 2.0
35 stars 23 forks source link

Service Proxy Generated JS fails to create proxy due to `undefined` value #67

Open InfoSec812 opened 7 years ago

InfoSec812 commented 7 years ago

Simplified example project HERE

  TestService.createProxy = function(vertx, ebAddress) {
    var __args = arguments;

    // The `__args[0]._jdel` object is `undefined`...
    if (__args.length === 2 && typeof __args[0] === 'object' && __args[0]._jdel && typeof __args[1] === 'string') {
      if (closed) {
        throw new Error('Proxy is closed');
      }
      j_eb.send(j_address, {"vertx":__args[0], "ebAddress":__args[1]}, {"action":"createProxy"});
      return;
    } else throw new TypeError('function invoked with invalid arguments');
  };

Regardless of what I have tried, the __args[0]._jdel object is always undefined.

InfoSec812 commented 7 years ago

Additionally, the createProxy method is a static method on the Class, but j_address and j_eb are fields on an instance and are not accessible.