[pypy-svn] r19635 - in pypy/dist/pypy/translator/js: . test
ericvrp at codespeak.net
ericvrp at codespeak.net
Tue Nov 8 13:57:50 CET 2005
Author: ericvrp
Date: Tue Nov 8 13:57:47 2005
New Revision: 19635
Modified:
pypy/dist/pypy/translator/js/database.py
pypy/dist/pypy/translator/js/test/browsertest.py
Log:
Fix for NaN and INF on Windows.
Things are working on all tested configurations:
OSX (Firefox & Safari)
Linux (Firefox)
Windows (Firefox & IE)
Modified: pypy/dist/pypy/translator/js/database.py
==============================================================================
--- pypy/dist/pypy/translator/js/database.py (original)
+++ pypy/dist/pypy/translator/js/database.py Tue Nov 8 13:57:47 2005
@@ -218,7 +218,7 @@
# llvm requires a . when using e notation
if "e" in repr and "." not in repr:
repr = repr.replace("e", ".0e")
- elif repr in ["inf", "nan"]:
+ elif repr in ["inf", "nan"] or 'INF' in repr or 'IND' in repr:
# Need hex repr
import struct
packed = struct.pack("d", value)
Modified: pypy/dist/pypy/translator/js/test/browsertest.py
==============================================================================
--- pypy/dist/pypy/translator/js/test/browsertest.py (original)
+++ pypy/dist/pypy/translator/js/test/browsertest.py Tue Nov 8 13:57:47 2005
@@ -16,6 +16,7 @@
<head>
<script type="text/javascript">
%(jscode)s
+// code for running the unittest...
function runTest() {
var result = undefined;
@@ -44,8 +45,8 @@
</head>
<body>
<pre>
-// %(jsfilename)s
-
+// filename: %(jsfilename)s
+// testcase: %(jstestcase)s
%(jscode)s
</pre>
</body>
@@ -87,6 +88,7 @@
# 1. we don't have the next testcase ready yet
# 2. browser should ask again when we do have a test
jsfilename = jstest.jsfilename
+ jstestcase = jstest.jstestcase
jscode = jstest.jscode
refresh_page = config.refresh_page % locals()
self.serve_data('text/html', refresh_page)
More information about the Pypy-commit
mailing list