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

Unified Diff: dart/tests/language/src/ParserQuirksTest.dart

Issue 9205003: Test that expose a few quirks in the Dart VM parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add comments. Created 8 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/language/src/ParserQuirksTest.dart
diff --git a/dart/tests/language/src/ParserQuirksTest.dart b/dart/tests/language/src/ParserQuirksTest.dart
new file mode 100644
index 0000000000000000000000000000000000000000..49681dfba54ae8413291da85f7df71e3097c1a62
--- /dev/null
+++ b/dart/tests/language/src/ParserQuirksTest.dart
@@ -0,0 +1,29 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test that a Dart implementation doesn't turn dynamic errors into
+// compilation errors.
+
+f(x) {}
+
+class MyClass {
+ MyClass(x, y);
+
+ foo() {
+ var z;
+ // Neither y nor x are defined. So they are simply dynamic
+ // (getter) sends to this, not compile-time errors.
+ if (false) f(new MyClass(z, y[x.y.z]));
+ if (false) print(y[x.y.z]);
+ }
+}
+
+main() {
+ var x;
+ // We know the concrete type of f (a function closure) does not
+ // support the index operator. However, this is a dynamic error, so
+ // this program should compile.
+ if (false) print(f[x.y.z]);
+ new MyClass(0, 0).foo();
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698