| Index: tests/language/regress_13494_test.dart
|
| diff --git a/tests/language/factory_return_type_checked_test.dart b/tests/language/regress_13494_test.dart
|
| similarity index 50%
|
| copy from tests/language/factory_return_type_checked_test.dart
|
| copy to tests/language/regress_13494_test.dart
|
| index dc46145d5e7565a4aec1661a61914b4ebcf8f54d..aaf975abe7921fe6f9af69740d9a0e8933ef4338 100644
|
| --- a/tests/language/factory_return_type_checked_test.dart
|
| +++ b/tests/language/regress_13494_test.dart
|
| @@ -2,22 +2,24 @@
|
| // 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 dart2js. Test that the argument to an unresolved static
|
| +// getter is only evaluated once.
|
| +
|
| import "package:expect/expect.dart";
|
|
|
| -class A {
|
| - factory A() => 42;
|
| -}
|
| +int i = 0;
|
| +
|
| +p(x) => i++;
|
| +
|
| +class A {}
|
|
|
| main() {
|
| - bool isCheckedMode = false;
|
| + bool caught = false;
|
| try {
|
| - String a = 42;
|
| - } catch (e) {
|
| - isCheckedMode = true;
|
| - }
|
| - if (isCheckedMode) {
|
| - Expect.throws(() => new A(), (e) => e is TypeError);
|
| - } else {
|
| - Expect.equals(42, new A());
|
| + A.unknown = p(2);
|
| + } catch (_) {
|
| + caught = true;
|
| }
|
| + Expect.isTrue(caught);
|
| + Expect.equals(1, i);
|
| }
|
|
|