| Index: dart/tests/language/crash_6725_test.dart
|
| diff --git a/dart/tests/language/crash_6725_test.dart b/dart/tests/language/crash_6725_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a3861f101b07ad4ceb3a5e9ca6e87613c21c248e
|
| --- /dev/null
|
| +++ b/dart/tests/language/crash_6725_test.dart
|
| @@ -0,0 +1,58 @@
|
| +// Copyright (c) 2013, 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.
|
| +
|
| +// Regression test for a crash in dart2js.
|
| +
|
| +class Fisk {
|
| + it1(x) {
|
| + // "key" is unresolved and caused a crash in dart2js.
|
| + // This is the original example the user reported.
|
| + for (key in x) {
|
| + print(key);
|
| + }
|
| + }
|
| +
|
| + it2(x) {
|
| + // "length" is "intercepted" and handled differently from other
|
| + // names when an instance of list is observed.
|
| + for (length in x) {
|
| + print(length);
|
| + }
|
| + }
|
| +
|
| + it3(x) {
|
| + // We're pretty sure that there's no "fisk" that is "intercepted".
|
| + for (fisk in x) {
|
| + print(fisk);
|
| + }
|
| + }
|
| +}
|
| +
|
| +class SubFisk extends Fisk {
|
| + var key;
|
| + var length;
|
| + var fisk;
|
| +}
|
| +
|
| +main() {
|
| + Fisk f = new SubFisk();
|
| + if (new DateTime.now() == null) {
|
| + f = null;
|
| + }
|
| +
|
| + f.it1([87, 42]);
|
| + if (f.key != 42) {
|
| + throw 'f.key != 42 (${f.key})';
|
| + }
|
| +
|
| + f.it2([87, 42]);
|
| + if (f.length != 42) {
|
| + throw 'f.length != 42 (${f.length})';
|
| + }
|
| +
|
| + f.it3([87, 42]);
|
| + if (f.fisk != 42) {
|
| + throw 'f.fisk != 42 (${f.fisk})';
|
| + }
|
| +}
|
|
|