| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013, 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 |
| 5 import "package:expect/expect.dart"; |
| 6 import 'compiler_helper.dart'; |
| 7 |
| 8 const String TEST = ''' |
| 9 foo(a) { |
| 10 foo([]); |
| 11 print(a[0]); |
| 12 } |
| 13 '''; |
| 14 |
| 15 main() { |
| 16 String generated = compile( |
| 17 TEST, |
| 18 entry: 'foo', |
| 19 interceptorsSource: DEFAULT_INTERCEPTORSLIB |
| 20 // ADD a bogus indexable class that does not have []. |
| 21 + 'class BogusIndexable implements JSIndexable {}'); |
| 22 |
| 23 // Ensure that we still generate an optimized version, even if there |
| 24 // is an indexable class that does not implement []. |
| 25 Expect.isTrue(!generated.contains('index')); |
| 26 } |
| OLD | NEW |