vert-x3 / vertx-lang-js

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

Unknown param type converter should return the Java delegate if possible #68

Closed tsegismont closed 7 years ago

tsegismont commented 7 years ago

utils.convParamTypeUnknown should return param._jdel if possible, instead of param

For example, trying to send a Buffer over the event bus ends with:

GRAVE: io.vertx.core.impl.ContextImpl - Unhandled exception 
java.lang.IllegalArgumentException: No message codec for type: class jdk.nashorn.api.scripting.ScriptObjectMirror
    at io.vertx.core.eventbus.impl.CodecManager.lookupCodec(CodecManager.java:90)
    at io.vertx.core.eventbus.impl.EventBusImpl.createMessage(EventBusImpl.java:229)
    at io.vertx.core.eventbus.impl.EventBusImpl.send(EventBusImpl.java:110)
    at io.vertx.core.eventbus.impl.EventBusImpl.send(EventBusImpl.java:95)
    at jdk.nashorn.internal.scripts.Script$Recompilation$147$2809AA$jvm_npm.L:1#EventBus#send(vertx-js/event_bus.js:76)
    at jdk.nashorn.internal.scripts.Script$Recompilation$143$576AA$event_bus_test.testSendBuffer#L:20(src/test/resources/event_bus_test.js:22)
    at jdk.nashorn.internal.scripts.Script$Recompilation$142$5785A$jvm_npm.L:1#MessageConsumer#completionHandler#L:188(vertx-js/message_consumer.js:190)
    at io.vertx.core.Handler$$NashornJavaAdapter.handle(Unknown Source)
    at io.vertx.core.eventbus.impl.HandlerRegistration.lambda$completionHandler$1(HandlerRegistration.java:97)
    at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:345)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:445)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    at java.lang.Thread.run(Thread.java:748)
tsegismont commented 7 years ago

Reopened due to bug hidden by this one.