Author: Stephan <[email protected]>
Branch:
Changeset: r176:6692b334fde3
Date: 2012-01-06 15:39 +0100
http://bitbucket.org/pypy/lang-js/changeset/6692b334fde3/
Log: deleted unused code
diff --git a/js/builtins.py b/js/builtins.py
--- a/js/builtins.py
+++ b/js/builtins.py
@@ -162,14 +162,6 @@
#def __init__(self, Class, Prototype, Value=w_Undefined):
#W_Object.__init__(self, Prototype, Class, Value)
-#class W_DateObject(W_NativeObject):
- #def Call(self, args=[], this=None):
- #return create_object('Object')
-
- #def Construct(self, args=[]):
- #v = int(time.time()*1000)
- #return create_object('Date', Value = W_IntNumber(v))
-
#@specialize.memo()
#def get_value_of(type):
#class W_ValueValueOf(W_NewBuiltin):
@@ -193,9 +185,6 @@
return result == -1
return a.ToString() < b.ToString()
-def versionjs(args, this):
- return w_Undefined
-
#class W_ObjectObject(W_NativeObject):
#def __init__(self, Class, Prototype, Value=w_Undefined):
#W_NativeObject.__init__(self, Class, Prototype, Value)
@@ -273,16 +262,6 @@
#def Construct(self, args=[]):
#return self.Call(args)
-_builtin_prototypes = {}
-def get_builtin_prototype(name):
- p = _builtin_prototypes.get(name, None)
- if p is None:
- return _builtin_prototypes.get('Object', None)
- return p
-
-def _register_builtin_prototype(name, obj):
- _builtin_prototypes[name] = obj
-
def new_native_function(ctx, function, name = None):
from js.jscode import Js_NativeFunction
from js.jsobj import W__Function
@@ -524,8 +503,6 @@
# 15.4.4.8
put_native_function(w_ArrayPrototype, 'reverse', array_builtins.reverse)
-
-
#Math
from js.jsobj import W_Math
# 15.8
diff --git a/js/js_interactive.py b/js/js_interactive.py
--- a/js/js_interactive.py
+++ b/js/js_interactive.py
@@ -8,8 +8,7 @@
import getopt
from js.interpreter import load_source, Interpreter, load_file
from js.jsparser import parse, ParseError
-from js.jsobj import W_Builtin, W_String, ThrowException, \
- w_Undefined, W_Boolean
+from js.jsobj import W_String, ThrowException, w_Undefined, W_Boolean
from pypy.rlib.streamio import open_file_as_stream
sys.setrecursionlimit(100)
diff --git a/js/jsobj.py b/js/jsobj.py
--- a/js/jsobj.py
+++ b/js/jsobj.py
@@ -409,7 +409,7 @@
def Construct(self, args=[]):
obj = W__Object()
proto = self.Get('prototype')
- if isinstance(proto, W_BasicObject) or isinstance(proto,
W_PrimitiveObject):
+ if isinstance(proto, W_BasicObject):
obj._prototype_ = proto
else:
# would love to test this
@@ -421,7 +421,7 @@
self.Call(args, this=obj)
except ReturnException, e:
result = e.value
- if isinstance(result, W_BasicObject) or isinstance(result,
W_PrimitiveObject):
+ if isinstance(result, W_BasicObject):
return result
return obj
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit