[pypy-commit] lang-js default: removed create_object
stepahn
noreply at buildbot.pypy.org
Fri Dec 28 11:33:00 CET 2012
Author: Stephan <stephan at stzal.com>
Branch:
Changeset: r162:23fd7a754873
Date: 2011-12-21 13:52 +0100
http://bitbucket.org/pypy/lang-js/changeset/23fd7a754873/
Log: removed create_object
diff --git a/js/builtins.py b/js/builtins.py
--- a/js/builtins.py
+++ b/js/builtins.py
@@ -1,6 +1,6 @@
import time
-from js.jsobj import w_Undefined, W_IntNumber, w_Null, create_object, W_Boolean,\
+from js.jsobj import w_Undefined, W_IntNumber, w_Null, W_Boolean,\
W_FloatNumber, W_String, newbool,\
isnull_or_undefined, W_Number,\
DONT_DELETE, DONT_ENUM, READ_ONLY, INTERNAL, _w
diff --git a/js/jsobj.py b/js/jsobj.py
--- a/js/jsobj.py
+++ b/js/jsobj.py
@@ -998,19 +998,6 @@
def empty(self):
return len(self.elements_w) == 0
-def create_object(prototypename, Value=w_Undefined):
- #proto = ctx.get_global().Get(prototypename).Get('prototype')
- from js.builtins import get_builtin_prototype
- proto = get_builtin_prototype(prototypename)
- obj = W__Object()
- # TODO get Object prototype from interp.w_Object
- #if isinstance(proto, W_PrimitiveObject):
- # obj = W_Object(Prototype=proto, Class = proto.Class, Value = Value)
- #elif isinstance(proto, W_BasicObject):
- # obj = W_Object(Prototype=proto, Class = proto.Class(), Value = Value)
- #obj.Put('__proto__', proto, DONT_ENUM | DONT_DELETE | READ_ONLY)
- return obj
-
def isnull_or_undefined(obj):
if obj is w_Null or obj is w_Undefined:
return True
diff --git a/js/opcodes.py b/js/opcodes.py
--- a/js/opcodes.py
+++ b/js/opcodes.py
@@ -1,5 +1,5 @@
from js.jsobj import W_IntNumber, W_FloatNumber, W_String,\
- create_object, w_Undefined, newbool,\
+ w_Undefined, newbool, W__Object, \
w_True, w_False, W_List, w_Null, W_Iterator, W_Root, W__Function
import js.jsobj as jsobj
from js.execution import JsTypeError, ReturnException, ThrowException
@@ -174,7 +174,7 @@
@jit.unroll_safe
def eval(self, ctx):
- w_obj = create_object('Object')
+ w_obj = W__Object()
for _ in range(self.counter):
name = ctx.pop().ToString()
w_elem = ctx.pop()
diff --git a/js/operations.py b/js/operations.py
--- a/js/operations.py
+++ b/js/operations.py
@@ -5,8 +5,7 @@
"""
from js.jsobj import W_IntNumber, W_FloatNumber, \
- w_Undefined, W_String, create_object, W_List,\
- W_Boolean,\
+ w_Undefined, W_String, W_List, W_Boolean,\
w_Null, isnull_or_undefined
from pypy.rlib.parsing.ebnfparse import Symbol, Nonterminal
from js.execution import JsTypeError, ThrowException
More information about the pypy-commit
mailing list