Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: compiler/javatests/com/google/dart/compiler/backend/js/JsConstructorOptTest.java

Issue 9232050: Issue 801. Use actual super constructor with all named or synthetic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiler/java/com/google/dart/compiler/backend/js/Normalizer.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8855f2cb2005a0a50b08d122d76f0586572628ed..54f8319e253d1768486e7f44b8fe2e30cdc9e93f 100644
--- a/compiler/javatests/com/google/dart/compiler/backend/js/JsConstructorOptTest.java
+++ b/compiler/javatests/com/google/dart/compiler/backend/js/JsConstructorOptTest.java
@@ -12,6 +12,33 @@ import java.io.IOException;
public class JsConstructorOptTest extends ExprOptTest {
/**
+ * When we call implicit "super" constructor we should be able to use non-default constructor with
+ * all named (i.e. optional) parameters.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=801
+ */
+ public void test_implicitConstructor_defaultValue() throws Exception {
+ String js =
+ compileSingleUnitSource(
+ makeCode(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class SuperClass {",
+ " SuperClass([name = 'John']) {",
+ " print(name);",
+ " }",
+ "}",
+ "class SubClass extends SuperClass {",
+ " SubClass([name = 'Maria']) {",
+ " print(name);",
+ " }",
+ "}",
+ ""),
+ "SubClass");
+ assertTrue(js.contains("Test_app4a54ba$SuperClass$Dart.$Initializer.call(this, 'John');"));
+ assertTrue(js.contains("Test_app4a54ba$SuperClass$Dart.$Constructor.call(this, 'John');"));
+ }
+
+ /**
* Test javascript object creation and inlining of field in the factory body.
*/
public void testConstructorOptTest() throws IOException {
« no previous file with comments | « compiler/java/com/google/dart/compiler/backend/js/Normalizer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698