[pypy-svn] r55543 - in pypy/branch/js-refactoring/pypy/lang/js: . test/ecma

santagada at codespeak.net santagada at codespeak.net
Wed Jun 4 01:55:44 CEST 2008


Author: santagada
Date: Wed Jun  4 01:55:41 2008
New Revision: 55543

Modified:
   pypy/branch/js-refactoring/pypy/lang/js/interpreter.py
   pypy/branch/js-refactoring/pypy/lang/js/test/ecma/shell.js
Log:
small changes on Function, Object types, and commented out some prints on shell.js

Modified: pypy/branch/js-refactoring/pypy/lang/js/interpreter.py
==============================================================================
--- pypy/branch/js-refactoring/pypy/lang/js/interpreter.py	(original)
+++ pypy/branch/js-refactoring/pypy/lang/js/interpreter.py	Wed Jun  4 01:55:41 2008
@@ -472,31 +472,31 @@
         
         allon = DE | DD | RO
         w_Global = W_Object(Class="global")
-
+        
         ctx = global_context(w_Global)
         
         w_ObjPrototype = W_Object(Prototype=None, Class='Object')
         
         w_Function = W_Function(ctx, Class='Function', 
                               Prototype=w_ObjPrototype)
-        
+        w_Function.Put(ctx, 'length', W_IntNumber(1), flags = allon)
         w_Global.Put(ctx, 'Function', w_Function)
         
         w_Object = W_ObjectObject('Object', w_Function)
         w_Object.Put(ctx, 'prototype', w_ObjPrototype, flags = allon)
-        
+        w_Object.Put(ctx, 'length', W_IntNumber(1), flags = RO | DD)
         w_Global.Put(ctx, 'Object', w_Object)
+        w_Global.Prototype = w_ObjPrototype
+        
         w_FncPrototype = w_Function.Call(ctx, this=w_Function)
         w_Function.Put(ctx, 'prototype', w_FncPrototype, flags = allon)
         w_Function.Put(ctx, 'constructor', w_Function)
         
-        w_Object.Put(ctx, 'length', W_IntNumber(1), flags = RO | DD)
-        
         toString = W_ToString(ctx)
         
         put_values(w_ObjPrototype, {
             'constructor': w_Object,
-            '__proto__': w_Null,
+            '__proto__': w_FncPrototype,
             'toString': toString,
             'toLocaleString': toString,
             'valueOf': W_ValueOf(ctx),
@@ -507,11 +507,12 @@
         
         #properties of the function prototype
         put_values(w_FncPrototype, {
-            'constructor': w_FncPrototype,
-            '__proto__': w_ObjPrototype,
+            'constructor': w_Function,
+            '__proto__': w_FncPrototype,
             'toString': W_FToString(ctx),
             'apply': W_Apply(ctx),
-            'call': W_Call(ctx),        
+            'call': W_Call(ctx),
+            'arguments': w_Null,
         })
         
         w_Boolean = W_BooleanObject('Boolean', w_FncPrototype)
@@ -529,7 +530,6 @@
         })
 
         w_Boolean.Put(ctx, 'prototype', w_BoolPrototype, flags = allon)
-
         w_Global.Put(ctx, 'Boolean', w_Boolean)
 
         #Number

Modified: pypy/branch/js-refactoring/pypy/lang/js/test/ecma/shell.js
==============================================================================
--- pypy/branch/js-refactoring/pypy/lang/js/test/ecma/shell.js	(original)
+++ pypy/branch/js-refactoring/pypy/lang/js/test/ecma/shell.js	Wed Jun  4 01:55:41 2008
@@ -120,9 +120,9 @@
 
   // print out bugnumber
 
-  if ( BUGNUMBER ) {
-    print ("BUGNUMBER: " + BUGNUMBER );
-  }
+  // if ( BUGNUMBER ) {
+  //   print ("BUGNUMBER: " + BUGNUMBER );
+  // }
 }
 
 function test() {



More information about the Pypy-commit mailing list