[pypy-svn] r43855 - in pypy/dist/pypy/lang/js: . test test/ecma/Array test/ecma/Boolean test/ecma/ExecutionContexts test/ecma/Expressions test/ecma/GlobalObject test/ecma/LexicalConventions test/ecma/Math test/ecma/String test/ecma/TypeConversion
santagada at codespeak.net
santagada at codespeak.net
Tue May 29 17:14:17 CEST 2007
Author: santagada
Date: Tue May 29 17:14:16 2007
New Revision: 43855
Modified:
pypy/dist/pypy/lang/js/astbuilder.py
pypy/dist/pypy/lang/js/interpreter.py
pypy/dist/pypy/lang/js/jsgrammar.txt
pypy/dist/pypy/lang/js/jsobj.py
pypy/dist/pypy/lang/js/jsparser.py
pypy/dist/pypy/lang/js/operations.py
pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.1-2.js
pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.1-3.js
pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.2-1.js
pypy/dist/pypy/lang/js/test/ecma/Array/15.4.5.1-2.js
pypy/dist/pypy/lang/js/test/ecma/Array/15.4.5.2-2.js
pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4-1.js
pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4-2.js
pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4.1.js
pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4.3-4-n.js
pypy/dist/pypy/lang/js/test/ecma/ExecutionContexts/10.2.3-1.js
pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-1.js
pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-2.js
pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-3.js
pypy/dist/pypy/lang/js/test/ecma/Expressions/11.4.8.js
pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.1.js
pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.2.js
pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.3.js
pypy/dist/pypy/lang/js/test/ecma/GlobalObject/15.1.2.2-2.js
pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.2-2-n.js
pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.2-3-n.js
pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.3-1.js
pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.4.3-4-n.js
pypy/dist/pypy/lang/js/test/ecma/Math/15.8.1.1-2.js
pypy/dist/pypy/lang/js/test/ecma/Math/15.8.1.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-1.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-2.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-3.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-5.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-6.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-1.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-2.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-3.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-4.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-5.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-1.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-2.js
pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-3.js
pypy/dist/pypy/lang/js/test/ecma/TypeConversion/9.6.js
pypy/dist/pypy/lang/js/test/test_interp.py
Log:
made a more broader way to make the last ; on a block of code be optional,
implemented shiftops and -= (sub in place).
also did a major reworking on how the Function creator work.
lot's of ; missing on ecma tests are fixed now.
Modified: pypy/dist/pypy/lang/js/astbuilder.py
==============================================================================
--- pypy/dist/pypy/lang/js/astbuilder.py (original)
+++ pypy/dist/pypy/lang/js/astbuilder.py Tue May 29 17:14:16 2007
@@ -5,7 +5,7 @@
class ASTBuilder(RPythonVisitor):
BINOP_TO_CLS = {
'+': operations.Plus,
- '-': operations.Minus,
+ '-': operations.Sub,
'*': operations.Mult,
'/': operations.Division,
'%': operations.Mod,
@@ -22,6 +22,9 @@
'>=': operations.Ge,
'<': operations.Lt,
'<=': operations.Le,
+ '>>': operations.Rsh,
+ '>>>': operations.Ursh,
+ '<<': operations.Lsh,
'.': operations.MemberDot,
'[': operations.Member,
',': operations.Comma,
@@ -97,6 +100,7 @@
visit_logicalorexpression = binaryop
visit_logicalandexpression = binaryop
visit_relationalexpression = binaryop
+ visit_shiftexpression = binaryop
visit_expression = binaryop
def visit_memberexpression(self, node):
@@ -295,6 +299,8 @@
i = 1
setup, i = self.get_next_expr(node, i)
condition, i = self.get_next_expr(node, i)
+ if isinstance(condition, operations.Undefined):
+ condition = operations.Boolean(pos, True)
update, i = self.get_next_expr(node, i)
body, i = self.get_next_expr(node, i)
return operations.For(pos, setup, condition, update, body)
Modified: pypy/dist/pypy/lang/js/interpreter.py
==============================================================================
--- pypy/dist/pypy/lang/js/interpreter.py (original)
+++ pypy/dist/pypy/lang/js/interpreter.py Tue May 29 17:14:16 2007
@@ -7,13 +7,14 @@
from pypy.rlib.objectmodel import we_are_translated
from pypy.rlib.streamio import open_file_as_stream
+ASTBUILDER = ASTBuilder()
+
def writer(x):
print x
def load_source(script_source):
- astb = ASTBuilder()
temp_tree = parse(script_source)
- return astb.dispatch(temp_tree)
+ return ASTBUILDER.dispatch(temp_tree)
def load_file(filename):
f = open_file_as_stream(filename)
@@ -45,10 +46,12 @@
for i in range(tam-1):
argslist.append(args[i].GetValue().ToString())
fargs = ','.join(argslist)
- functioncode = "__anon__ = function (%s) {%s}"%(fargs, fbody)
+ functioncode = "function (%s) {%s}"%(fargs, fbody)
else:
- functioncode = "__anon__ = function () {}"
- return evaljs(ctx, [W_String(functioncode),], this)
+ functioncode = "function () {}"
+ #remove program and sourcelements node
+ funcnode = parse(functioncode).children[0].children[0]
+ return ASTBUILDER.dispatch(funcnode).execute(ctx)
def parseIntjs(ctx, args, this):
if len(args) < 1:
Modified: pypy/dist/pypy/lang/js/jsgrammar.txt
==============================================================================
--- pypy/dist/pypy/lang/js/jsgrammar.txt (original)
+++ pypy/dist/pypy/lang/js/jsgrammar.txt Tue May 29 17:14:16 2007
@@ -6,13 +6,18 @@
;
sourceelements : sourceelement >sourceelements<
- | sourceelement
+ | sourceelementsemiopt
;
sourceelement : <functiondeclaration>
| <statement>
;
+sourceelementsemiopt : <functiondeclaration>
+ | <statementsemiopt>
+ ;
+
+
statement : <block>
| <variablestatement> [";"]
| <emptystatement>
Modified: pypy/dist/pypy/lang/js/jsobj.py
==============================================================================
--- pypy/dist/pypy/lang/js/jsobj.py (original)
+++ pypy/dist/pypy/lang/js/jsobj.py Tue May 29 17:14:16 2007
@@ -70,6 +70,7 @@
return r_uint(0)
def Get(self, P):
+ print P
raise NotImplementedError
def Put(self, P, V, dd=False,
Modified: pypy/dist/pypy/lang/js/jsparser.py
==============================================================================
--- pypy/dist/pypy/lang/js/jsparser.py (original)
+++ pypy/dist/pypy/lang/js/jsparser.py Tue May 29 17:14:16 2007
@@ -14,11 +14,5 @@
parsef = make_parse_function(regexs, rules, eof=True)
def parse(code):
- try:
- t = parsef(code)
- except ParseError:
- code += ';'
- print code
- t = parsef(code)
-
+ t = parsef(code)
return ToAST().transform(t)
Modified: pypy/dist/pypy/lang/js/operations.py
==============================================================================
--- pypy/dist/pypy/lang/js/operations.py (original)
+++ pypy/dist/pypy/lang/js/operations.py Tue May 29 17:14:16 2007
@@ -67,12 +67,15 @@
class UnaryOp(Expression):
def __init__(self, pos, expr, postfix=False):
self.pos = pos
+ assert isinstance(expr, Node)
self.expr = expr
self.postfix = postfix
class BinaryOp(Expression):
def __init__(self, pos, left, right):
self.pos = pos
+ assert isinstance(left, Node)
+ assert isinstance(right, Node)
self.left = left
self.right = right
@@ -130,6 +133,8 @@
val = mult(ctx, v1.GetValue(), v3)
elif op == "+=":
val = plus(ctx, v1.GetValue(), v3)
+ elif op == "-=":
+ val = sub(ctx, v1.GetValue(), v3)
elif op == "/=":
val = division(ctx, v1.GetValue(), v3)
elif op == "%=":
@@ -638,7 +643,7 @@
fright = nright.ToNumber()
return W_Number(fleft / fright)
-def minus(ctx, nleft, nright):
+def sub(ctx, nleft, nright):
fleft = nleft.ToNumber()
fright = nright.ToNumber()
return W_Number(fleft - fright)
@@ -660,8 +665,8 @@
mathop = staticmethod(division)
-class Minus(BinaryNumberOp):
- mathop = staticmethod(minus)
+class Sub(BinaryNumberOp):
+ mathop = staticmethod(sub)
class Null(Expression):
@@ -970,6 +975,7 @@
class ForIn(Statement):
def __init__(self, pos, iterator, lobject, body):
self.pos = pos
+ assert isinstance(iterator, Node)
self.iterator = iterator
self.object = lobject
self.body = body
@@ -992,7 +998,7 @@
class For(Statement):
def __init__(self, pos, setup, condition, update, body):
- self.pos = pos
+ self.pos = pos
self.setup = setup
self.condition = condition
self.update = update
Modified: pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.1-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.1-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.1-2.js Tue May 29 17:14:16 2007
@@ -72,7 +72,7 @@
var TEST_STRING = "new Array(";
-var ARGUMENTS = ""
+var ARGUMENTS = "";
var TEST_LENGTH = Math.pow(2,10); //Math.pow(2,32);
for ( var index = 0; index < TEST_LENGTH; index++ ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.1-3.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.1-3.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.1-3.js Tue May 29 17:14:16 2007
@@ -78,7 +78,7 @@
writeHeaderToLog( SECTION + " "+ TITLE);
var TEST_STRING = "new Array(";
-var ARGUMENTS = ""
+var ARGUMENTS = "";
var TEST_LENGTH = Math.pow(2,10); //Math.pow(2,32);
for ( var index = 0; index < TEST_LENGTH; index++ ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.2-1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.2-1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Array/15.4.2.2-1.js Tue May 29 17:14:16 2007
@@ -169,9 +169,8 @@
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
- n = sign * Math.floor( Math.abs(n) )
-
- n = n % Math.pow(2,32);
+ n = sign * Math.floor( Math.abs(n) );
+ n = n % Math.pow(2,32);
if ( n < 0 ){
n += Math.pow(2,32);
Modified: pypy/dist/pypy/lang/js/test/ecma/Array/15.4.5.1-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Array/15.4.5.1-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Array/15.4.5.1-2.js Tue May 29 17:14:16 2007
@@ -89,7 +89,7 @@
AddCase( "3.00", "three" );
AddCase( "00010", "eight" );
AddCase( "37xyz", "thirty-five" );
-AddCase("5000000000", 5)
+AddCase("5000000000", 5);
AddCase( "-2", -3 );
new TestCase( SECTION,
Modified: pypy/dist/pypy/lang/js/test/ecma/Array/15.4.5.2-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Array/15.4.5.2-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Array/15.4.5.2-2.js Tue May 29 17:14:16 2007
@@ -66,7 +66,7 @@
addCase( new Array(Math.pow(2,12)), Math.pow(2,12), 0, 0 );
addCase( new Array(Math.pow(2,13)), Math.pow(2,13), Math.pow(2,12), Math.pow(2,12) );
addCase( new Array(Math.pow(2,12)), Math.pow(2,12), Math.pow(2,12), Math.pow(2,12) );
-addCase( new Array(Math.pow(2,14)), Math.pow(2,14), Math.pow(2,12), Math.pow(2,12) )
+addCase( new Array(Math.pow(2,14)), Math.pow(2,14), Math.pow(2,12), Math.pow(2,12) );
// some tests where array is not empty
// array is populated with strings
Modified: pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4-1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4-1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4-1.js Tue May 29 17:14:16 2007
@@ -53,7 +53,7 @@
*/
-var VERSION = "ECMA_1"
+var VERSION = "ECMA_1";
startTest();
var SECTION = "15.6.4-1";
Modified: pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4-2.js Tue May 29 17:14:16 2007
@@ -53,7 +53,7 @@
*/
-var VERSION = "ECMA_2"
+var VERSION = "ECMA_2";
startTest();
var SECTION = "15.6.4-2";
Modified: pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4.1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4.1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4.1.js Tue May 29 17:14:16 2007
@@ -50,7 +50,7 @@
var SECTION = "15.6.4.1";
var VERSION = "ECMA_1";
startTest();
-var TITLE = "Boolean.prototype.constructor"
+var TITLE = "Boolean.prototype.constructor";
writeHeaderToLog( SECTION + TITLE );
new TestCase( SECTION,
Modified: pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4.3-4-n.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4.3-4-n.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Boolean/15.6.4.3-4-n.js Tue May 29 17:14:16 2007
@@ -56,7 +56,7 @@
writeHeaderToLog( SECTION + " "+ TITLE);
-DESCRIPTION = "valof=Boolean.prototype.valueOf; x=new String( 'hello' ); x.valueOf=valof;x.valueOf()"
+DESCRIPTION = "valof=Boolean.prototype.valueOf; x=new String( 'hello' ); x.valueOf=valof;x.valueOf()";
EXPECTED = "error";
new TestCase( SECTION,
Modified: pypy/dist/pypy/lang/js/test/ecma/ExecutionContexts/10.2.3-1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/ExecutionContexts/10.2.3-1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/ExecutionContexts/10.2.3-1.js Tue May 29 17:14:16 2007
@@ -60,7 +60,7 @@
writeHeaderToLog( SECTION + " "+ TITLE);
-var o = new MyObject("hello")
+var o = new MyObject("hello");
new TestCase( SECTION,
"var o = new MyObject('hello'); o.THIS == x",
Modified: pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-1.js Tue May 29 17:14:16 2007
@@ -94,6 +94,7 @@
}
return ( sign * Math.floor(Math.abs(n)) );
}
+
function ToInt32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
@@ -107,6 +108,7 @@
return ( n );
}
+
function ToUint32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
@@ -114,9 +116,8 @@
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
- n = sign * Math.floor( Math.abs(n) )
-
- n = n % Math.pow(2,32);
+ n = sign * Math.floor( Math.abs(n) );
+ n = n % Math.pow(2,32);
if ( n < 0 ){
n += Math.pow(2,32);
Modified: pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-2.js Tue May 29 17:14:16 2007
@@ -113,7 +113,7 @@
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
- n = sign * Math.floor( Math.abs(n) )
+ n = sign * Math.floor( Math.abs(n) );
n = n % Math.pow(2,32);
Modified: pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-3.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-3.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Expressions/11.10-3.js Tue May 29 17:14:16 2007
@@ -113,7 +113,7 @@
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
- n = sign * Math.floor( Math.abs(n) )
+ n = sign * Math.floor( Math.abs(n) );
n = n % Math.pow(2,32);
Modified: pypy/dist/pypy/lang/js/test/ecma/Expressions/11.4.8.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Expressions/11.4.8.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Expressions/11.4.8.js Tue May 29 17:14:16 2007
@@ -105,7 +105,7 @@
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
- n = sign * Math.floor( Math.abs(n) )
+ n = sign * Math.floor( Math.abs(n) );
n = n % Math.pow(2,32);
Modified: pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.1.js Tue May 29 17:14:16 2007
@@ -112,7 +112,7 @@
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
- n = sign * Math.floor( Math.abs(n) )
+ n = sign * Math.floor( Math.abs(n) );
n = n % Math.pow(2,32);
Modified: pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.2.js Tue May 29 17:14:16 2007
@@ -127,7 +127,7 @@
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
- n = sign * Math.floor( Math.abs(n) )
+ n = sign * Math.floor( Math.abs(n) );
n = n % Math.pow(2,32);
Modified: pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.3.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.3.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Expressions/11.7.3.js Tue May 29 17:14:16 2007
@@ -118,7 +118,7 @@
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
- n = sign * Math.floor( Math.abs(n) )
+ n = sign * Math.floor( Math.abs(n) );
n = n % Math.pow(2,32);
Modified: pypy/dist/pypy/lang/js/test/ecma/GlobalObject/15.1.2.2-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/GlobalObject/15.1.2.2-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/GlobalObject/15.1.2.2-2.js Tue May 29 17:14:16 2007
@@ -173,7 +173,7 @@
parseInt("0x1000000000000081") );
s =
-"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
s += "0000000000000000000000000000000000000";
Modified: pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.2-2-n.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.2-2-n.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.2-2-n.js Tue May 29 17:14:16 2007
@@ -64,7 +64,7 @@
writeHeaderToLog( SECTION + " "+ TITLE);
DESCRIPTION = "\r\r\r\nb";
-EXPECTED = "error"
+EXPECTED = "error";
new TestCase( SECTION, DESCRIPTION, "error", eval("\r\r\r\nb"));
Modified: pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.2-3-n.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.2-3-n.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.2-3-n.js Tue May 29 17:14:16 2007
@@ -63,7 +63,7 @@
DESCRIPTION = "\r\nb";
-EXPECTED = "error"
+EXPECTED = "error";
new TestCase( SECTION, "<cr>a", "error", eval("\r\nb"));
Modified: pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.3-1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.3-1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.3-1.js Tue May 29 17:14:16 2007
@@ -68,7 +68,7 @@
"pass",
"" );
-var x = "// test \n testcase.actual = 'pass'"
+var x = "// test \n testcase.actual = 'pass'";
testcase.actual = eval(x);
Modified: pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.4.3-4-n.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.4.3-4-n.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/LexicalConventions/7.4.3-4-n.js Tue May 29 17:14:16 2007
@@ -79,7 +79,7 @@
jsOptions.reset();
-DESCRIPTION = "var super = true"
+DESCRIPTION = "var super = true";
EXPECTED = "error";
// force exception since this is a negative test
Modified: pypy/dist/pypy/lang/js/test/ecma/Math/15.8.1.1-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Math/15.8.1.1-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Math/15.8.1.1-2.js Tue May 29 17:14:16 2007
@@ -54,7 +54,7 @@
writeHeaderToLog( SECTION + " "+ TITLE);
-var MATH_E = 2.7182818284590452354
+var MATH_E = 2.7182818284590452354;
new TestCase( SECTION,
"delete(Math.E)",
false,
Modified: pypy/dist/pypy/lang/js/test/ecma/Math/15.8.1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/Math/15.8.1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/Math/15.8.1.js Tue May 29 17:14:16 2007
@@ -52,7 +52,7 @@
Date: 7 july 1997
*/
-var SECTION = "15.8.1"
+var SECTION = "15.8.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Value Properties of the Math Object";
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-1.js Tue May 29 17:14:16 2007
@@ -93,7 +93,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-2.js Tue May 29 17:14:16 2007
@@ -90,7 +90,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-3.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-3.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-3.js Tue May 29 17:14:16 2007
@@ -89,7 +89,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-5.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-5.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-5.js Tue May 29 17:14:16 2007
@@ -95,7 +95,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-6.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-6.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.11-6.js Tue May 29 17:14:16 2007
@@ -91,7 +91,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-1.js Tue May 29 17:14:16 2007
@@ -95,7 +95,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-2.js Tue May 29 17:14:16 2007
@@ -92,7 +92,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-3.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-3.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-3.js Tue May 29 17:14:16 2007
@@ -134,7 +134,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-4.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-4.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-4.js Tue May 29 17:14:16 2007
@@ -90,7 +90,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-5.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-5.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.12-5.js Tue May 29 17:14:16 2007
@@ -90,7 +90,7 @@
function Unicode( c ) {
u = GetUnicodeValues( c );
this.upper = u[0];
- this.lower = u[1]
+ this.lower = u[1];
return this;
}
function GetUnicodeValues( c ) {
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-1.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-1.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-1.js Tue May 29 17:14:16 2007
@@ -164,10 +164,10 @@
test();
function LastIndexOf( string, search, position ) {
- string = String( string );
- search = String( search );
+ string = String( string );
+ search = String( search );
- position = Number( position )
+ position = Number( position );
if ( isNaN( position ) ) {
position = Infinity;
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-2.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-2.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-2.js Tue May 29 17:14:16 2007
@@ -165,7 +165,7 @@
string = String( string );
search = String( search );
- position = Number( position )
+ position = Number( position );
if ( isNaN( position ) ) {
position = Infinity;
Modified: pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-3.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-3.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/String/15.5.4.7-3.js Tue May 29 17:14:16 2007
@@ -109,7 +109,7 @@
string = String( string );
search = String( search );
- position = Number( position )
+ position = Number( position );
if ( isNaN( position ) ) {
position = Infinity;
Modified: pypy/dist/pypy/lang/js/test/ecma/TypeConversion/9.6.js
==============================================================================
--- pypy/dist/pypy/lang/js/test/ecma/TypeConversion/9.6.js (original)
+++ pypy/dist/pypy/lang/js/test/ecma/TypeConversion/9.6.js Tue May 29 17:14:16 2007
@@ -125,7 +125,7 @@
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
- n = sign * Math.floor( Math.abs(n) )
+ n = sign * Math.floor( Math.abs(n) );
n = n % Math.pow(2,32);
Modified: pypy/dist/pypy/lang/js/test/test_interp.py
==============================================================================
--- pypy/dist/pypy/lang/js/test/test_interp.py (original)
+++ pypy/dist/pypy/lang/js/test/test_interp.py Tue May 29 17:14:16 2007
@@ -495,6 +495,10 @@
yield assertv, "2 ^ 2;", 0
yield assertv, "2 & 3;", 2
yield assertv, "2 | 3;", 3
+ yield assertv, "2 << 2;", 8
+ yield assertv, "4 >> 2;", 1
+ yield assertv, "-2 >> 31", -1
+ yield assertv, "-2 >>> 31;", 1
def test_for_vararg():
assertp("""
@@ -531,6 +535,7 @@
def test_inplace_assign():
yield assertv, "x=1; x+=1; x;", 2
+ yield assertv, "x=1; x-=1; x;", 0
yield assertv, "x=2; x*=2; x;", 4
yield assertv, "x=2; x/=2; x;", 1
yield assertv, "x=4; x%=2; x;", 0
@@ -550,3 +555,6 @@
def test_semicolon():
assertv("1", 1)
+
+def test_functionjs():
+ assertv("x = Function('return 1'); x()", 1)
\ No newline at end of file
More information about the Pypy-commit
mailing list