This changes the calling convention for calling a Javascript function from Python so that any proxied arguments are automatically destroyed at the end of the function call. This is a breaking change. It should make it much more convenient to use the foreign function interface. 

The docs need to be updated to explain the new calling convention before this can be merged. We should put a link to the appropriate section in the docs into the error message emitted when a borrowed proxy is used after it is free so that people have an easy time learning the model by trial and error.
ENH Destroy proxies created in JsProxy.__call__ when done with call. This changes the calling convention for calling a Javascript function from Python so that any proxied arguments are automatically destroyed at the end of the function call. This is a breaking change. It should make it much more convenient to use the foreign function interface. 

The docs need to be updated to explain the new calling convention before this can be merged. We should put a link to the appropriate section in the docs into the error message emitted when a borrowed proxy is used after it is free so that people have an easy time learning the model by trial and error.
commit a80460f1b45035d34575866e6394107396ac62e2
Author: Michael Danilov <mike402@users.noreply.github.com>
Date:   Thu Apr 20 18:08:39 2017 +0200

    Fix build with GCC5.

diff --git a/scipy/odr/odrpack/d_lpkbls.f b/scipy/odr/odrpack/d_lpkbls.f
index 324b7a8a2..1e6624d63 100644
--- a/scipy/odr/odrpack/d_lpkbls.f
+++ b/scipy/odr/odrpack/d_lpkbls.f
@@ -136,8 +136,8 @@ C***FIRST EXECUTABLE STATEMENT  DAXPY
 
 
       IF(N.LE.0.OR.DA.EQ.0.D0) RETURN
-      IF (INCX.EQ.INCY) IF(INCX.lt.1) GOTO 5
-      IF (INCX.EQ.INCY) IF(INCX.eq.1) GOTO 20
+      IF (INCX.EQ.INCY .AND. INCX.lt.1) GOTO 5
+      IF (INCX.EQ.INCY .AND. INCX.eq.1) GOTO 20
       GOTO 60
     5 CONTINUE
 
@@ -483,8 +483,8 @@ C***FIRST EXECUTABLE STATEMENT  DCOPY
 
 
       IF(N.LE.0)RETURN
-      IF (INCX.EQ.INCY) IF(INCX.lt.1) GOTO 5
-      IF (INCX.EQ.INCY) IF(INCX.eq.1) GOTO 20
+      IF (INCX.EQ.INCY .AND. INCX.lt.1) GOTO 5
+      IF (INCX.EQ.INCY .AND. INCX.eq.1) GOTO 20
       GOTO 60
     5 CONTINUE
 
@@ -589,8 +589,8 @@ C***FIRST EXECUTABLE STATEMENT  DDOT
 
       DDOT = 0.D0
       IF(N.LE.0)RETURN
-      IF (INCX.EQ.INCY) IF(INCX.lt.1) GOTO 5
-      IF (INCX.EQ.INCY) IF(INCX.eq.1) GOTO 20
+      IF (INCX.EQ.INCY .AND. INCX.lt.1) GOTO 5
+      IF (INCX.EQ.INCY .AND. INCX.eq.1) GOTO 20
       GOTO 60
     5 CONTINUE
 
@@ -1772,8 +1772,8 @@ C***FIRST EXECUTABLE STATEMENT  DSWAP
 
 
       IF(N.LE.0)RETURN
-      IF (INCX.EQ.INCY) IF(INCX.lt.1) GOTO 5
-      IF (INCX.EQ.INCY) IF(INCX.eq.1) GOTO 20
+      IF (INCX.EQ.INCY .AND. INCX.lt.1) GOTO 5
+      IF (INCX.EQ.INCY .AND. INCX.eq.1) GOTO 20
       GOTO 60
     5 CONTINUE
 

commit a80460f1b45035d34575866e6394107396ac62e2
Author: Michael Danilov <mike402@users.noreply.github.com>
Date:   Thu Apr 20 18:08:39 2017 +0200

    Fix build with GCC5.

diff --git a/scipy/odr/odrpack/d_lpkbls.f b/scipy/odr/odrpack/d_lpkbls.f
index 324b7a8a2..1e6624d63 100644
--- a/scipy/odr/odrpack/d_lpkbls.f
+++ b/scipy/odr/odrpack/d_lpkbls.f
@@ -136,8 +136,8 @@ C***FIRST EXECUTABLE STATEMENT  DAXPY
 
 
       IF(N.LE.0.OR.DA.EQ.0.D0) RETURN
-      IF (INCX.EQ.INCY) IF(INCX.lt.1) GOTO 5
-      IF (INCX.EQ.INCY) IF(INCX.eq.1) GOTO 20
+      IF (INCX.EQ.INCY .AND. INCX.lt.1) GOTO 5
+      IF (INCX.EQ.INCY .AND. INCX.eq.1) GOTO 20
       GOTO 60
     5 CONTINUE
 
@@ -483,8 +483,8 @@ C***FIRST EXECUTABLE STATEMENT  DCOPY
 
 
       IF(N.LE.0)RETURN
-      IF (INCX.EQ.INCY) IF(INCX.lt.1) GOTO 5
-      IF (INCX.EQ.INCY) IF(INCX.eq.1) GOTO 20
+      IF (INCX.EQ.INCY .AND. INCX.lt.1) GOTO 5
+      IF (INCX.EQ.INCY .AND. INCX.eq.1) GOTO 20
       GOTO 60
     5 CONTINUE
 
@@ -589,8 +589,8 @@ C***FIRST EXECUTABLE STATEMENT  DDOT
 
       DDOT = 0.D0
       IF(N.LE.0)RETURN
-      IF (INCX.EQ.INCY) IF(INCX.lt.1) GOTO 5
-      IF (INCX.EQ.INCY) IF(INCX.eq.1) GOTO 20
+      IF (INCX.EQ.INCY .AND. INCX.lt.1) GOTO 5
+      IF (INCX.EQ.INCY .AND. INCX.eq.1) GOTO 20
       GOTO 60
     5 CONTINUE
 
@@ -1772,8 +1772,8 @@ C***FIRST EXECUTABLE STATEMENT  DSWAP
 
 
       IF(N.LE.0)RETURN
-      IF (INCX.EQ.INCY) IF(INCX.lt.1) GOTO 5
-      IF (INCX.EQ.INCY) IF(INCX.eq.1) GOTO 20
+      IF (INCX.EQ.INCY .AND. INCX.lt.1) GOTO 5
+      IF (INCX.EQ.INCY .AND. INCX.eq.1) GOTO 20
       GOTO 60
     5 CONTINUE
 
