Bug 1332052 - Test framework for Reflect.parse now checks undefined. r=evilpie
authorKevin Gibbons <bakkot@gmail.com>
Wed, 18 Jan 2017 22:28:03 +0100
changeset 377351 d33a2f279d1354a7502b70e02788df61877fab14
parent 377350 05018a650beebbc9dff35616350b673bfc46cdfd
child 377352 98ee7f4c3b1acb2ec084e5f4fb20a0a493783aae
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevilpie
bugs1332052
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1332052 - Test framework for Reflect.parse now checks undefined. r=evilpie
js/src/tests/js1_8_5/reflect-parse/Match.js
js/src/tests/js1_8_5/reflect-parse/declarations.js
js/src/tests/js1_8_5/reflect-parse/destructuring-function-parameters.js
js/src/tests/js1_8_5/reflect-parse/expressionClosures.js
js/src/tests/js1_8_5/reflect-parse/statements.js
--- a/js/src/tests/js1_8_5/reflect-parse/Match.js
+++ b/js/src/tests/js1_8_5/reflect-parse/Match.js
@@ -68,16 +68,17 @@ var Match =
         }
     };
 
     function isAtom(x) {
         return (typeof x === "number") ||
             (typeof x === "string") ||
             (typeof x === "boolean") ||
             (x === null) ||
+            (x === undefined) ||
             (typeof x === "object" && x instanceof RegExp);
     }
 
     function isObject(x) {
         return (x !== null) && (typeof x === "object");
     }
 
     function isFunction(x) {
@@ -104,16 +105,17 @@ var Match =
         if (exp instanceof RegExp) {
             if (!(act instanceof RegExp) || exp.source !== act.source)
                 throw new MatchError("expected " + quote(exp) + ", got: " + quote(act));
             return true;
         }
 
         switch (typeof exp) {
         case "string":
+        case "undefined":
             if (act !== exp)
                 throw new MatchError("expected " + quote(exp) + ", got " + quote(act));
             return true;
         case "boolean":
         case "number":
             if (exp !== act)
                 throw new MatchError("expected " + exp + ", got " + quote(act));
             return true;
--- a/js/src/tests/js1_8_5/reflect-parse/declarations.js
+++ b/js/src/tests/js1_8_5/reflect-parse/declarations.js
@@ -73,17 +73,17 @@ assertStmt("function f() { var x = 42; v
 
 assertDecl("var {x:y} = foo;", varDecl([{ id: objPatt([assignProp("x", ident("y"))]),
                                           init: ident("foo") }]));
 assertDecl("var {x} = foo;", varDecl([{ id: objPatt([assignProp("x")]),
                                         init: ident("foo") }]));
 
 // Bug 632030: redeclarations between var and funargs, var and function
 assertStmt("function g(x) { var x }",
-           funDecl(ident("g"), [ident("x")], blockStmt([varDecl[{ id: ident("x"), init: null }]])));
+           funDecl(ident("g"), [ident("x")], blockStmt([varDecl([{ id: ident("x"), init: null }])])));
 assertProg("f.p = 1; var f; f.p; function f(){}",
            [exprStmt(aExpr("=", dotExpr(ident("f"), ident("p")), lit(1))),
             varDecl([{ id: ident("f"), init: null }]),
             exprStmt(dotExpr(ident("f"), ident("p"))),
             funDecl(ident("f"), [], blockStmt([]))]);
 }
 
 assertBlockStmt("{ function f(x) {} }",
--- a/js/src/tests/js1_8_5/reflect-parse/destructuring-function-parameters.js
+++ b/js/src/tests/js1_8_5/reflect-parse/destructuring-function-parameters.js
@@ -11,17 +11,17 @@ function testParamPatternCombinations(ma
         function makeSrc(body) {
             return "(function(" + pattSrcs[i].join(",") + ") " + body + ")";
         }
         function makePatt(body) {
             return funExpr(null, pattPatts[i], body);
         }
 
         // no upvars, block body
-        assertExpr(makeSrc("{ }", makePatt(blockStmt([]))));
+        assertExpr(makeSrc("{ }"), makePatt(blockStmt([])));
         // upvars, block body
         assertExpr(makeSrc("{ return [x1,x2,x3,x4,x5]; }"),
                    makePatt(blockStmt([returnStmt(arrExpr([ident("x1"), ident("x2"), ident("x3"), ident("x4"), ident("x5")]))])));
         if (JS_HAS_EXPR_CLOSURES) {
             // no upvars, expression body
             assertExpr(makeSrc("(0)"), makePatt(lit(0)));
             // upvars, expression body
             assertExpr(makeSrc("[x1,x2,x3,x4,x5]"),
--- a/js/src/tests/js1_8_5/reflect-parse/expressionClosures.js
+++ b/js/src/tests/js1_8_5/reflect-parse/expressionClosures.js
@@ -1,11 +1,11 @@
 // |reftest| skip-if(!xulRuntime.shell)
 function test() {
 
 // expression closures
 
 assertDecl("function inc(x) (x + 1)", funDecl(ident("inc"), [ident("x")], binExpr("+", ident("x"), lit(1))));
-assertExpr("(function(x) (x+1))", funExpr(null, [ident("x")], binExpr("+"), ident("x"), lit(1)));
+assertExpr("(function(x) (x+1))", funExpr(null, [ident("x")], binExpr("+", ident("x"), lit(1))));
 
 }
 
 runtest(test);
--- a/js/src/tests/js1_8_5/reflect-parse/statements.js
+++ b/js/src/tests/js1_8_5/reflect-parse/statements.js
@@ -1,21 +1,21 @@
 // |reftest| skip-if(!xulRuntime.shell)
 function test() {
 
 // statements
 
 assertStmt("throw 42", throwStmt(lit(42)));
 assertStmt("for (;;) break", forStmt(null, null, null, breakStmt(null)));
 assertStmt("for (x; y; z) break", forStmt(ident("x"), ident("y"), ident("z"), breakStmt(null)));
-assertStmt("for (var x; y; z) break", forStmt(varDecl([{ id: ident("x"), init: null }]), ident("y"), ident("z")));
-assertStmt("for (var x = 42; y; z) break", forStmt(varDecl([{ id: ident("x"), init: lit(42) }]), ident("y"), ident("z")));
+assertStmt("for (var x; y; z) break", forStmt(varDecl([{ id: ident("x"), init: null }]), ident("y"), ident("z"), breakStmt(null)));
+assertStmt("for (var x = 42; y; z) break", forStmt(varDecl([{ id: ident("x"), init: lit(42) }]), ident("y"), ident("z"), breakStmt(null)));
 assertStmt("for (x; ; z) break", forStmt(ident("x"), null, ident("z"), breakStmt(null)));
-assertStmt("for (var x; ; z) break", forStmt(varDecl([{ id: ident("x"), init: null }]), null, ident("z")));
-assertStmt("for (var x = 42; ; z) break", forStmt(varDecl([{ id: ident("x"), init: lit(42) }]), null, ident("z")));
+assertStmt("for (var x; ; z) break", forStmt(varDecl([{ id: ident("x"), init: null }]), null, ident("z"), breakStmt(null)));
+assertStmt("for (var x = 42; ; z) break", forStmt(varDecl([{ id: ident("x"), init: lit(42) }]), null, ident("z"), breakStmt(null)));
 assertStmt("for (x; y; ) break", forStmt(ident("x"), ident("y"), null, breakStmt(null)));
 assertStmt("for (var x; y; ) break", forStmt(varDecl([{ id: ident("x"), init: null }]), ident("y"), null, breakStmt(null)));
 assertStmt("for (var x = 42; y; ) break", forStmt(varDecl([{ id: ident("x"), init: lit(42) }]), ident("y"), null, breakStmt(null)));
 assertStmt("for (var x in y) break", forInStmt(varDecl([{ id: ident("x"), init: null }]), ident("y"), breakStmt(null)));
 assertStmt("for (x in y) break", forInStmt(ident("x"), ident("y"), breakStmt(null)));
 assertStmt("{ }", blockStmt([]));
 assertStmt("{ throw 1; throw 2; throw 3; }", blockStmt([ throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))]));
 assertStmt(";", emptyStmt);