--- a/m4/_js.m4
+++ b/m4/_js.m4
@@ -214,3 +214,20 @@
     fi
     AC_SUBST(NSPR_CFLAGS)
    ])
+
+AC_DEFUN([GXINE_JS_CHECK_TYPES],
+   [JSFLOAT64=n
+    AC_MSG_CHECKING([for JSFloat64])
+    SAVED_CFLAGS="$CFLAGS"
+    CFLAGS="$JS_CFLAGS $CFLAGS"
+    AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM(
+        [[#include <jsapi.h>]],
+        [[JSFloat64 test = 0.0;]]
+      )],
+      [AC_DEFINE([HAVE_JSFLOAT64], [1], [Define if JSFloat64 is declared])
+       AC_MSG_RESULT([yes])],
+      [AC_MSG_RESULT([no])],
+    )
+    CFLAGS="$SAVED_CFLAGS"
+   ])