Author: Stephan <[email protected]>
Branch:
Changeset: r169:392eb2efa651
Date: 2012-01-06 14:49 +0100
http://bitbucket.org/pypy/lang-js/changeset/392eb2efa651/
Log: initialize length of W_StringObject
diff --git a/js/jsobj.py b/js/jsobj.py
--- a/js/jsobj.py
+++ b/js/jsobj.py
@@ -357,6 +357,10 @@
class W_StringObject(W__PrimitiveObject):
_class_ = 'String'
+ def __init__(self, primitive_value):
+ W__PrimitiveObject.__init__(self, primitive_value)
+ length = len(self._primitive_value_.ToString())
+ self._set_property('length', _w(length), DONT_ENUM | DONT_DELETE |
READ_ONLY )
class W__Object(W_BasicObject):
def ToString(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit