OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // Issue 24043. |
| 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
| 8 class EvilMatch implements Match { |
| 9 int get start => 100000000; |
| 10 int get end => 3; |
| 11 } |
| 12 |
| 13 class EvilIterator implements Iterator { |
| 14 bool moveNext() => true; |
| 15 EvilMatch get current => new EvilMatch(); |
| 16 } |
| 17 |
| 18 class EvilIterable extends Iterable { |
| 19 Iterator get iterator => new EvilIterator(); |
| 20 } |
| 21 |
| 22 class EvilPattern { |
| 23 Iterable allMatches(String s) => new EvilIterable(); |
| 24 } |
| 25 |
| 26 void main() { |
| 27 Expect.throws(() => "foo".split(new EvilPattern())[0].length, |
| 28 (e) => e is RangeError); |
| 29 } |
OLD | NEW |