OLD | NEW |
---|---|
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library trydart.incremental_compilation_update_test; | 5 library trydart.incremental_compilation_update_test; |
6 | 6 |
7 import 'dart:html' hide | 7 import 'dart:html' hide |
8 Element; | 8 Element; |
9 | 9 |
10 import 'dart:async' show | 10 import 'dart:async' show |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1202 print('closure is null'); | 1202 print('closure is null'); |
1203 closure = new C().foo; | 1203 closure = new C().foo; |
1204 } | 1204 } |
1205 closure(named: 'v2'); | 1205 closure(named: 'v2'); |
1206 } | 1206 } |
1207 """, | 1207 """, |
1208 const <String>['v2']), | 1208 const <String>['v2']), |
1209 ], | 1209 ], |
1210 | 1210 |
1211 // Test that a lazy static is supported. | 1211 // Test that a lazy static is supported. |
1212 // TODO(ahe): This test doesn't pass yet. | |
1213 const <ProgramResult>[ | 1212 const <ProgramResult>[ |
1214 const ProgramResult( | 1213 const ProgramResult( |
1215 r""" | 1214 r""" |
1216 var normal; | 1215 var normal; |
1217 | 1216 |
1218 foo() { | 1217 foo() { |
1219 print(normal); | 1218 print(normal); |
1220 } | 1219 } |
1221 | 1220 |
1222 main() { | 1221 main() { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1286 } | 1285 } |
1287 """, | 1286 """, |
1288 const <String>['v2']), | 1287 const <String>['v2']), |
1289 ], | 1288 ], |
1290 | 1289 |
1291 // Test that interceptor classes are handled correctly. | 1290 // Test that interceptor classes are handled correctly. |
1292 const <ProgramResult>[ | 1291 const <ProgramResult>[ |
1293 const ProgramResult( | 1292 const ProgramResult( |
1294 r""" | 1293 r""" |
1295 main() { | 1294 main() { |
1296 // TODO(ahe): Remove next line when new constants are handled correctly. | |
1297 [].map(null); | |
1298 print('v1'); | 1295 print('v1'); |
1299 } | 1296 } |
1300 """, | 1297 """, |
1301 const <String>['v1']), | 1298 const <String>['v1']), |
1302 const ProgramResult( | 1299 const ProgramResult( |
1303 r""" | 1300 r""" |
1304 main() { | 1301 main() { |
1305 ['v2'].forEach(print); | 1302 ['v2'].forEach(print); |
1306 } | 1303 } |
1307 """, | 1304 """, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1365 | 1362 |
1366 class B extends A { | 1363 class B extends A { |
1367 } | 1364 } |
1368 | 1365 |
1369 main() { | 1366 main() { |
1370 new A().bar(); | 1367 new A().bar(); |
1371 } | 1368 } |
1372 """, | 1369 """, |
1373 const <String>['Called bar']), | 1370 const <String>['Called bar']), |
1374 ], | 1371 ], |
1372 | |
1373 // Test that constants are handled correctly. | |
1374 const <ProgramResult>[ | |
1375 const ProgramResult( | |
1376 r""" | |
1377 class C { | |
1378 final String value; | |
1379 const C(this.value); | |
1380 } | |
1381 | |
1382 main() { | |
1383 print(const C('v1').value); | |
1384 } | |
1385 """, | |
1386 const <String>['v1']), | |
1387 const ProgramResult( | |
1388 r""" | |
1389 class C { | |
1390 final String value; | |
1391 const C(this.value); | |
1392 } | |
1393 | |
1394 main() { | |
1395 print(const C('v2').value); | |
1396 } | |
1397 """, | |
1398 const <String>['v2']), | |
1399 ], | |
Johnni Winther
2014/12/09 12:07:16
Add tests with dependent constants like const C(co
ahe
2014/12/11 10:09:00
Will do in follow up CL.
| |
1375 ]; | 1400 ]; |
1376 | 1401 |
1377 void main() { | 1402 void main() { |
1378 listener.start(); | 1403 listener.start(); |
1379 | 1404 |
1380 document.head.append(lineNumberStyle()); | 1405 document.head.append(lineNumberStyle()); |
1381 | 1406 |
1382 summary = new SpanElement(); | 1407 summary = new SpanElement(); |
1383 document.body.append(new HeadingElement.h1() | 1408 document.body.append(new HeadingElement.h1() |
1384 ..appendText("Incremental compiler tests") | 1409 ..appendText("Incremental compiler tests") |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1563 position: absolute; | 1588 position: absolute; |
1564 left: 0px; | 1589 left: 0px; |
1565 width: 3em; | 1590 width: 3em; |
1566 text-align: right; | 1591 text-align: right; |
1567 background-color: lightgoldenrodyellow; | 1592 background-color: lightgoldenrodyellow; |
1568 } | 1593 } |
1569 '''); | 1594 '''); |
1570 style.type = 'text/css'; | 1595 style.type = 'text/css'; |
1571 return style; | 1596 return style; |
1572 } | 1597 } |
OLD | NEW |