[pypy-svn] r33901 - pypy/dist/pypy/lang/js
arigo at codespeak.net
arigo at codespeak.net
Mon Oct 30 15:56:21 CET 2006
Author: arigo
Date: Mon Oct 30 15:56:20 2006
New Revision: 33901
Modified:
pypy/dist/pypy/lang/js/parser.py
Log:
Apparently, various js interpreters give errors in various styles.
Try to detect errors by looking if the output starts with the
expected "{" or not.
Modified: pypy/dist/pypy/lang/js/parser.py
==============================================================================
--- pypy/dist/pypy/lang/js/parser.py (original)
+++ pypy/dist/pypy/lang/js/parser.py Mon Oct 30 15:56:20 2006
@@ -21,7 +21,7 @@
pipe.stdin.write("print(parse('%s'));\n" % stripped_code)
pipe.stdin.close()
retval = pipe.stdout.read()
- if retval.startswith(":"):
+ if not retval.startswith("{"):
raise JsSyntaxError(retval)
return retval
More information about the Pypy-commit
mailing list