nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java
changeset 17756 daaa1e643f71
parent 17744 65849f87aa28
child 18614 addca7a10167
--- 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);
     }
 
     /**