[pypy-svn] r42063 - in pypy/dist/pypy/translator/js: . jssrc test
fijal at codespeak.net
fijal at codespeak.net
Sun Apr 15 18:32:56 CEST 2007
Author: fijal
Date: Sun Apr 15 18:32:55 2007
New Revision: 42063
Modified:
pypy/dist/pypy/translator/js/jssrc/misc.js
pypy/dist/pypy/translator/js/metavm.py
pypy/dist/pypy/translator/js/opcodes.py
pypy/dist/pypy/translator/js/test/test_rclass.py
pypy/dist/pypy/translator/js/test/test_rpbc.py
Log:
Add few hacks to pass few more tests
Modified: pypy/dist/pypy/translator/js/jssrc/misc.js
==============================================================================
--- pypy/dist/pypy/translator/js/jssrc/misc.js (original)
+++ pypy/dist/pypy/translator/js/jssrc/misc.js Sun Apr 15 18:32:55 2007
@@ -22,6 +22,9 @@
}
function isinstanceof(self, what) {
+ if (!self) {
+ return (false);
+ }
t = self.constructor;
while ( t ) {
if (t == what) {
@@ -216,5 +219,11 @@
}
return (i);
}
-
+
+function convertToString(stuff) {
+ if (stuff === undefined) {
+ return ("undefined");
+ }
+ return (stuff.toString());
+}
// ends hand written code
Modified: pypy/dist/pypy/translator/js/metavm.py
==============================================================================
--- pypy/dist/pypy/translator/js/metavm.py (original)
+++ pypy/dist/pypy/translator/js/metavm.py Sun Apr 15 18:32:55 2007
@@ -250,5 +250,5 @@
IsInstance = _IsInstance()
CallMethod = _CallMethod()
CopyName = [PushAllArgs, _SameAs ()]
-CastString = _CastMethod("toString")
+CastString = _CastFun("convertToString", 1)
SameAs = CopyName
Modified: pypy/dist/pypy/translator/js/opcodes.py
==============================================================================
--- pypy/dist/pypy/translator/js/opcodes.py (original)
+++ pypy/dist/pypy/translator/js/opcodes.py Sun Apr 15 18:32:55 2007
@@ -117,6 +117,7 @@
'new' : [New],
'runtimenew' : [RuntimeNew],
'instanceof' : [IsInstance],
+ #'subclassof' : [IsSubclassOf],
# objects
Modified: pypy/dist/pypy/translator/js/test/test_rclass.py
==============================================================================
--- pypy/dist/pypy/translator/js/test/test_rclass.py (original)
+++ pypy/dist/pypy/translator/js/test/test_rclass.py Sun Apr 15 18:32:55 2007
@@ -8,6 +8,8 @@
class TestJsException(JsTest, BaseTestException):
pass
+# ====> ../../../rpython/test/test_rclass.py
+
class TestJsClass(JsTest, BaseTestRclass):
def test___class___attribute(self):
class Base(object): pass
@@ -70,6 +72,6 @@
def test_issubclass_type(self):
py.test.skip("WIP")
- def test_isinstance(self):
- py.test.skip("WIP")
+ #def test_isinstance(self):
+ # py.test.skip("WIP")
Modified: pypy/dist/pypy/translator/js/test/test_rpbc.py
==============================================================================
--- pypy/dist/pypy/translator/js/test/test_rpbc.py (original)
+++ pypy/dist/pypy/translator/js/test/test_rpbc.py Sun Apr 15 18:32:55 2007
@@ -3,6 +3,8 @@
from pypy.translator.js.test.runtest import JsTest
from pypy.rpython.test.test_rpbc import BaseTestRPBC
+# ====> ../../../rpython/test/test_rpbc.py
+
class TestJsPBC(JsTest, BaseTestRPBC):
def test_single_pbc_getattr(self):
class C:
@@ -31,10 +33,4 @@
def test_call_memoized_function_with_bools(self):
py.test.skip("WIP")
-
- def test_conv_from_None(self):
- py.test.skip("WIP")
-
- def test_multiple_ll_one_hl_op(self):
- py.test.skip("XXX fix me soon")
More information about the Pypy-commit
mailing list