[pypy-svn] r39368 - in pypy/dist/pypy/translator/js/modules: . test

fijal at codespeak.net fijal at codespeak.net
Sat Feb 24 18:00:55 CET 2007


Author: fijal
Date: Sat Feb 24 18:00:49 2007
New Revision: 39368

Added:
   pypy/dist/pypy/translator/js/modules/test/test_mochikit.py
Modified:
   pypy/dist/pypy/translator/js/modules/mochikit.py
Log:
User register_external and a test


Modified: pypy/dist/pypy/translator/js/modules/mochikit.py
==============================================================================
--- pypy/dist/pypy/translator/js/modules/mochikit.py	(original)
+++ pypy/dist/pypy/translator/js/modules/mochikit.py	Sat Feb 24 18:00:49 2007
@@ -2,6 +2,8 @@
 """ mochikit wrappers
 """
 
+from pypy.rpython.extfunc import register_external
+
 def createLoggingPane(var):
     pass
 createLoggingPane.suggested_primitive = True
@@ -34,4 +36,5 @@
 
 def escapeHTML(data):
     return data
-escapeHTML.suggested_primitive = True
+register_external(escapeHTML, args=[str], result=str)
+

Added: pypy/dist/pypy/translator/js/modules/test/test_mochikit.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/translator/js/modules/test/test_mochikit.py	Sat Feb 24 18:00:49 2007
@@ -0,0 +1,9 @@
+
+from pypy.translator.js.lib.support import js_source
+from pypy.translator.js.modules.mochikit import *
+
+class TestRender(object):
+    def test_escape_html(self):
+        def x():
+            escapeHTML("xxx") + "xxx"
+        assert js_source([x], use_pdb=False)



More information about the Pypy-commit mailing list