--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java Fri May 17 16:44:22 2013 -0300
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java Mon May 20 16:38:38 2013 +0200
@@ -91,12 +91,13 @@
CompiledFunction bind(final CompiledFunction originalInv, final ScriptFunction fn, final Object self, final Object[] args) {
final MethodHandle boundInvoker = bindInvokeHandle(originalInv.getInvoker(), fn, self, args);
+ //TODO the boundinvoker.type() could actually be more specific here
if (isConstructor()) {
ensureConstructor(originalInv);
- return new CompiledFunction(boundInvoker, bindConstructHandle(originalInv.getConstructor(), fn, args));
+ return new CompiledFunction(boundInvoker.type(), boundInvoker, bindConstructHandle(originalInv.getConstructor(), fn, args));
}
- return new CompiledFunction(boundInvoker);
+ return new CompiledFunction(boundInvoker.type(), boundInvoker);
}
/**