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 // Regression test for dart2js that used to crash when compiling | |
6 // [foo]. See http://code.google.com/p/dart/issues/detail?id=7448. | |
7 | |
8 library ports_compilation; | |
9 import 'dart:html'; | |
10 import 'dart:isolate'; | |
11 import 'package:unittest/unittest.dart'; | |
12 import 'package:unittest/html_config.dart'; | |
13 | |
14 void foo() { | |
15 // Create a "SendPortSync" object and access one of its members. | |
16 SendPortSync s_port; | |
17 s_port.callSync; | |
18 | |
19 // Create a "ReceivePortSync" object (with the constructor) and | |
20 // access one of its members. | |
21 var r_port = new ReceivePortSync(); | |
22 r_port.receive; | |
23 | |
24 // Call getComputedStyle() from the HTML library. | |
25 query("").getComputedStyle(""); | |
26 } | |
27 | |
28 int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1)); | |
29 | |
30 void main() { | |
31 // Generate the call, but don't execute it. | |
32 if (inscrutable(1) != 1) foo(); | |
33 useHtmlConfiguration(); | |
34 bar(); | |
35 // Also generate it here in case the compiler's worklist goes from | |
36 // last seen to first seen. | |
37 if (inscrutable(1) != 1) foo(); | |
38 } | |
39 | |
40 bar() { | |
41 test('compile', () { }); | |
42 } | |
OLD | NEW |