OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart2js; | 5 part of dart2js; |
6 | 6 |
7 /** | 7 /** |
8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
9 * compiled. | 9 * compiled. |
10 */ | 10 */ |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 } | 587 } |
588 | 588 |
589 // TODO(karlklose,floitsch): move this to the javascript backend. | 589 // TODO(karlklose,floitsch): move this to the javascript backend. |
590 /** Enable the 'JS' helper for a library if needed. */ | 590 /** Enable the 'JS' helper for a library if needed. */ |
591 void maybeEnableJSHelper(LibraryElement library) { | 591 void maybeEnableJSHelper(LibraryElement library) { |
592 String libraryName = library.uri.toString(); | 592 String libraryName = library.uri.toString(); |
593 bool nativeTest = library.entryCompilationUnit.script.name.contains( | 593 bool nativeTest = library.entryCompilationUnit.script.name.contains( |
594 'dart/tests/compiler/dart2js_native'); | 594 'dart/tests/compiler/dart2js_native'); |
595 if (nativeTest | 595 if (nativeTest |
596 || libraryName == 'dart:async' | 596 || libraryName == 'dart:async' |
| 597 || libraryName == 'dart:chrome' |
597 || libraryName == 'dart:mirrors' | 598 || libraryName == 'dart:mirrors' |
598 || libraryName == 'dart:math' | 599 || libraryName == 'dart:math' |
599 || libraryName == 'dart:html' | 600 || libraryName == 'dart:html' |
600 || libraryName == 'dart:html_common' | 601 || libraryName == 'dart:html_common' |
601 || libraryName == 'dart:indexed_db' | 602 || libraryName == 'dart:indexed_db' |
602 || libraryName == 'dart:svg' | 603 || libraryName == 'dart:svg' |
603 || libraryName == 'dart:web_audio') { | 604 || libraryName == 'dart:web_audio') { |
604 if (nativeTest | 605 if (nativeTest |
605 || libraryName == 'dart:html' | 606 || libraryName == 'dart:html' |
606 || libraryName == 'dart:html_common' | 607 || libraryName == 'dart:html_common' |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 // TODO(johnniwinther): Use [spannable] and [message] to provide better | 1079 // TODO(johnniwinther): Use [spannable] and [message] to provide better |
1079 // information on assertion errors. | 1080 // information on assertion errors. |
1080 if (condition is Function){ | 1081 if (condition is Function){ |
1081 condition = condition(); | 1082 condition = condition(); |
1082 } | 1083 } |
1083 if (spannable == null || !condition) { | 1084 if (spannable == null || !condition) { |
1084 throw new SpannableAssertionFailure(spannable, message); | 1085 throw new SpannableAssertionFailure(spannable, message); |
1085 } | 1086 } |
1086 return true; | 1087 return true; |
1087 } | 1088 } |
OLD | NEW |