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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 11419300: Dartifying dart:html type names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporating review feedback. Created 8 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
OLDNEW
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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 const SourceString('DART_CLOSURE_TO_JS'), library), this); 498 const SourceString('DART_CLOSURE_TO_JS'), library), this);
499 } 499 }
500 500
501 // TODO(karlklose,floitsch): move this to the javascript backend. 501 // TODO(karlklose,floitsch): move this to the javascript backend.
502 /** Enable the 'JS' helper for a library if needed. */ 502 /** Enable the 'JS' helper for a library if needed. */
503 void maybeEnableJSHelper(LibraryElement library) { 503 void maybeEnableJSHelper(LibraryElement library) {
504 String libraryName = library.uri.toString(); 504 String libraryName = library.uri.toString();
505 bool nativeTest = library.entryCompilationUnit.script.name.contains( 505 bool nativeTest = library.entryCompilationUnit.script.name.contains(
506 'dart/tests/compiler/dart2js_native'); 506 'dart/tests/compiler/dart2js_native');
507 if (nativeTest 507 if (nativeTest
508 || libraryName == 'dart:html_common'
508 || libraryName == 'dart:mirrors' 509 || libraryName == 'dart:mirrors'
509 || libraryName == 'dart:isolate' 510 || libraryName == 'dart:isolate'
510 || libraryName == 'dart:math' 511 || libraryName == 'dart:math'
511 || libraryName == 'dart:html' 512 || libraryName == 'dart:html'
512 || libraryName == 'dart:html_common' 513 || libraryName == 'dart:indexed_db'
513 || libraryName == 'dart:svg' 514 || libraryName == 'dart:svg'
514 || libraryName == 'dart:web_audio') { 515 || libraryName == 'dart:web_audio') {
515 if (nativeTest 516 if (nativeTest
516 || libraryName == 'dart:html' 517 || libraryName == 'dart:html'
517 || libraryName == 'dart:html_common' 518 || libraryName == 'dart:html_common'
519 || libraryName == 'dart:indexed_db'
518 || libraryName == 'dart:svg' 520 || libraryName == 'dart:svg'
519 || libraryName == 'dart:mirrors') { 521 || libraryName == 'dart:mirrors') {
520 // dart:html and dart:svg need access to convertDartClosureToJS and 522 // dart:html and dart:svg need access to convertDartClosureToJS and
521 // annotation classes. 523 // annotation classes.
522 // dart:mirrors needs access to the Primitives class. 524 // dart:mirrors needs access to the Primitives class.
523 importHelperLibrary(library); 525 importHelperLibrary(library);
524 } 526 }
525 library.addToScope(findHelper(const SourceString('JS')), this); 527 library.addToScope(findHelper(const SourceString('JS')), this);
526 Element jsIndexingBehaviorInterface = 528 Element jsIndexingBehaviorInterface =
527 findHelper(const SourceString('JavaScriptIndexingBehavior')); 529 findHelper(const SourceString('JavaScriptIndexingBehavior'));
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 // TODO(johnniwinther): Use [spannable] and [message] to provide better 945 // TODO(johnniwinther): Use [spannable] and [message] to provide better
944 // information on assertion errors. 946 // information on assertion errors.
945 if (condition is Function){ 947 if (condition is Function){
946 condition = condition(); 948 condition = condition();
947 } 949 }
948 if (spannable == null || !condition) { 950 if (spannable == null || !condition) {
949 throw new SpannableAssertionFailure(spannable, message); 951 throw new SpannableAssertionFailure(spannable, message);
950 } 952 }
951 return true; 953 return true;
952 } 954 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698