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

Side by Side Diff: tests/compiler/dart2js/unused_empty_map_test.dart

Issue 769533003: Mark empty HashMap constructor as NoThrows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: added test Created 6 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/collection_patch.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, 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 // Ensure that unused empty HashMap nodes are dropped from the output.
6
7 import 'package:expect/expect.dart';
8 import 'package:async_helper/async_helper.dart';
9 import 'memory_compiler.dart';
10
11 const TEST_SOURCE = const {"main.dart": r"""
12 void main() {
13 var x = {};
14 return;
15 }
16 """};
17
18 const HASHMAP_EMPTY_CONSTRUCTOR = r"LinkedHashMap_LinkedHashMap$_empty";
19
20 main() {
21 var collector = new OutputCollector();
22 var compiler = compilerFor(TEST_SOURCE, outputProvider: collector);
23 asyncTest(() =>
24 compiler.run(Uri.parse('memory:main.dart')).then((_) {
25 String generated = collector.getOutput('', 'js');
26 Expect.isFalse(generated.contains(HASHMAP_EMPTY_CONSTRUCTOR));
27 })
28 );
29 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/collection_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698