| Index: compiler/javatests/com/google/dart/compiler/backend/js/JsConstructorOptTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/backend/js/JsConstructorOptTest.java b/compiler/javatests/com/google/dart/compiler/backend/js/JsConstructorOptTest.java
|
| index 745364f504e268c12abe30ea52233cc97519fb96..c4b2372446c68cdf148a0b265f798b49134290a6 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/backend/js/JsConstructorOptTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/backend/js/JsConstructorOptTest.java
|
| @@ -43,8 +43,7 @@ public class JsConstructorOptTest extends ExprOptTest {
|
|
|
| String[] bodyLines = getFunctionBody("AAA$$Factory", classAAA);
|
|
|
| - assertTrue(bodyLines.length > 0);
|
| - assertEquals(bodyLines.length, 7);
|
| + assertEquals(8, bodyLines.length);
|
|
|
| String tmp_init_a = bodyLines[0].trim();
|
| assertEquals("var init$a$field = a;", tmp_init_a);
|
| @@ -62,7 +61,9 @@ public class JsConstructorOptTest extends ExprOptTest {
|
| assertEquals("var tmp = new Test_app4a54ba$AAA$Dart(init$a$field, init$b$field, "
|
| + "init$c$field, init$d$field);", newCall);
|
|
|
| - String ctorCall = replaceTemps(bodyLines[5].trim());
|
| + assertTrue(bodyLines[5].indexOf("$lookupRTT()") != -1);
|
| +
|
| + String ctorCall = replaceTemps(bodyLines[6].trim());
|
| assertTrue(ctorCall.indexOf("$Constructor.call") != -1);
|
| }
|
|
|
| @@ -82,19 +83,20 @@ public class JsConstructorOptTest extends ExprOptTest {
|
| {
|
| String[] bodyLines = getFunctionBody("BBB$$Factory", classBBB);
|
|
|
| - assertTrue(bodyLines.length > 0);
|
| - assertEquals(bodyLines.length, 4);
|
| + assertEquals(5, bodyLines.length);
|
|
|
| String line1 = replaceTemps(bodyLines[0].trim());
|
| assertEquals("var tmp = new Test_app4a54ba$BBB$Dart;", line1);
|
|
|
| - String initCall = replaceTemps(bodyLines[1].trim());
|
| + assertTrue(bodyLines[1].indexOf("$lookupRTT()") != -1);
|
| +
|
| + String initCall = replaceTemps(bodyLines[2].trim());
|
| assertTrue(initCall.indexOf("$Initializer.call") != -1);
|
|
|
| - String ctorCall = replaceTemps(bodyLines[2].trim());
|
| + String ctorCall = replaceTemps(bodyLines[3].trim());
|
| assertTrue(ctorCall.indexOf("$Constructor.call") != -1);
|
|
|
| - String returnStmt = replaceTemps(bodyLines[3].trim());
|
| + String returnStmt = replaceTemps(bodyLines[4].trim());
|
| assertEquals("return tmp;", returnStmt);
|
| }
|
|
|
| @@ -102,19 +104,20 @@ public class JsConstructorOptTest extends ExprOptTest {
|
| {
|
| String[] bodyLines = getFunctionBody("CCC$$Factory", classCCC);
|
|
|
| - assertTrue(bodyLines.length > 0);
|
| - assertEquals(bodyLines.length, 4);
|
| + assertEquals(5, bodyLines.length);
|
|
|
| String line1 = replaceTemps(bodyLines[0].trim());
|
| assertEquals("var tmp = new Test_app4a54ba$CCC$Dart;", line1);
|
|
|
| - String initCall = replaceTemps(bodyLines[1].trim());
|
| + assertTrue(bodyLines[1].indexOf("$lookupRTT()") != -1);
|
| +
|
| + String initCall = replaceTemps(bodyLines[2].trim());
|
| assertTrue(initCall.indexOf("$Initializer.call") != -1);
|
|
|
| - String ctorCall = replaceTemps(bodyLines[2].trim());
|
| + String ctorCall = replaceTemps(bodyLines[3].trim());
|
| assertTrue(ctorCall.indexOf("$Constructor.call") != -1);
|
|
|
| - String returnStmt = replaceTemps(bodyLines[3].trim());
|
| + String returnStmt = replaceTemps(bodyLines[4].trim());
|
| assertEquals("return tmp;", returnStmt);
|
| }
|
|
|
| @@ -127,8 +130,7 @@ public class JsConstructorOptTest extends ExprOptTest {
|
| String classDDD = compileSingleUnit(getName(), "DDD");
|
| String[] bodyLines = getFunctionBody("DDD$$Factory", classDDD);
|
|
|
| - assertTrue(bodyLines.length > 0);
|
| - assertEquals(bodyLines.length, 8);
|
| + assertEquals(8, bodyLines.length);
|
| assertEquals("switch (arguments.length) {", replaceTemps(bodyLines[0].trim()));
|
| assertEquals("case 1:", replaceTemps(bodyLines[1].trim()));
|
| assertEquals("z = 123;", replaceTemps(bodyLines[2].trim()));
|
|
|