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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 normal = 'v1'; | 1283 normal = 'v1'; |
1284 } else { | 1284 } else { |
1285 normal = ''; | 1285 normal = ''; |
1286 } | 1286 } |
1287 foo(); | 1287 foo(); |
1288 } | 1288 } |
1289 """, | 1289 """, |
1290 const <String>['v2', 'lazy']), | 1290 const <String>['v2', 'lazy']), |
1291 ], | 1291 ], |
1292 */ | 1292 */ |
| 1293 |
| 1294 // Test that superclasses of directly instantiated classes are also |
| 1295 // emitted. |
| 1296 const <ProgramResult>[ |
| 1297 const ProgramResult( |
| 1298 r""" |
| 1299 class A { |
| 1300 } |
| 1301 |
| 1302 class B extends A { |
| 1303 } |
| 1304 |
| 1305 main() { |
| 1306 print('v1'); |
| 1307 } |
| 1308 """, |
| 1309 const <String>['v1']), |
| 1310 const ProgramResult( |
| 1311 r""" |
| 1312 class A { |
| 1313 } |
| 1314 |
| 1315 class B extends A { |
| 1316 } |
| 1317 |
| 1318 main() { |
| 1319 new B(); |
| 1320 print('v2'); |
| 1321 } |
| 1322 """, |
| 1323 const <String>['v2']), |
| 1324 ], |
| 1325 |
| 1326 // Test that interceptor classes are handled correctly. |
| 1327 const <ProgramResult>[ |
| 1328 const ProgramResult( |
| 1329 r""" |
| 1330 main() { |
| 1331 // TODO(ahe): Remove next line when new constants are handled correctly. |
| 1332 [].map(null); |
| 1333 print('v1'); |
| 1334 } |
| 1335 """, |
| 1336 const <String>['v1']), |
| 1337 const ProgramResult( |
| 1338 r""" |
| 1339 main() { |
| 1340 // TODO(ahe): Use forEach(print) when closures are computed correctly. |
| 1341 ['v2'].forEach((e) { print(e); }); |
| 1342 } |
| 1343 """, |
| 1344 const <String>['v2']), |
| 1345 ], |
1293 ]; | 1346 ]; |
1294 | 1347 |
1295 void main() { | 1348 void main() { |
1296 listener.start(); | 1349 listener.start(); |
1297 | 1350 |
1298 document.head.append(lineNumberStyle()); | 1351 document.head.append(lineNumberStyle()); |
1299 | 1352 |
1300 String query = window.location.search; | 1353 String query = window.location.search; |
1301 int skip = 0; | 1354 int skip = 0; |
1302 if (query != null && query.length > 1) { | 1355 if (query != null && query.length > 1) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 program.code, test.incrementalCompiler.mainApp, | 1418 program.code, test.incrementalCompiler.mainApp, |
1366 test.incrementalCompiler.compiler).run(); | 1419 test.incrementalCompiler.compiler).run(); |
1367 }); | 1420 }); |
1368 }); | 1421 }); |
1369 }); | 1422 }); |
1370 }); | 1423 }); |
1371 }); | 1424 }); |
1372 }).then((_) { | 1425 }).then((_) { |
1373 status.style.color = 'limegreen'; | 1426 status.style.color = 'limegreen'; |
1374 | 1427 |
1375 // Remove the iframe to work around a bug in test.dart. | 1428 // Remove the iframe and status to work around a bug in test.dart |
| 1429 // (https://code.google.com/p/dart/issues/detail?id=21691). |
| 1430 status.remove(); |
1376 iframe.remove(); | 1431 iframe.remove(); |
1377 }); | 1432 }); |
1378 } | 1433 } |
1379 | 1434 |
1380 class SerializeScopeTestCase extends CompilerTestCase { | 1435 class SerializeScopeTestCase extends CompilerTestCase { |
1381 final String scopeInfo; | 1436 final String scopeInfo; |
1382 | 1437 |
1383 SerializeScopeTestCase( | 1438 SerializeScopeTestCase( |
1384 String source, | 1439 String source, |
1385 LibraryElement library, | 1440 LibraryElement library, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 position: absolute; | 1522 position: absolute; |
1468 left: 0px; | 1523 left: 0px; |
1469 width: 3em; | 1524 width: 3em; |
1470 text-align: right; | 1525 text-align: right; |
1471 background-color: lightgoldenrodyellow; | 1526 background-color: lightgoldenrodyellow; |
1472 } | 1527 } |
1473 '''); | 1528 '''); |
1474 style.type = 'text/css'; | 1529 style.type = 'text/css'; |
1475 return style; | 1530 return style; |
1476 } | 1531 } |
OLD | NEW |