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

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

Issue 11624011: Mirrors implemented via patches. 2nd try. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Second attempt 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 } 527 }
528 } 528 }
529 529
530 // TODO(karlklose,floitsch): move this to the javascript backend. 530 // TODO(karlklose,floitsch): move this to the javascript backend.
531 /** Enable the 'JS' helper for a library if needed. */ 531 /** Enable the 'JS' helper for a library if needed. */
532 void maybeEnableJSHelper(LibraryElement library) { 532 void maybeEnableJSHelper(LibraryElement library) {
533 String libraryName = library.uri.toString(); 533 String libraryName = library.uri.toString();
534 bool nativeTest = library.entryCompilationUnit.script.name.contains( 534 bool nativeTest = library.entryCompilationUnit.script.name.contains(
535 'dart/tests/compiler/dart2js_native'); 535 'dart/tests/compiler/dart2js_native');
536 if (nativeTest 536 if (nativeTest
537 || libraryName == 'dart:mirrors'
538 || libraryName == 'dart:math' 537 || libraryName == 'dart:math'
539 || libraryName == 'dart:html' 538 || libraryName == 'dart:html'
540 || libraryName == 'dart:html_common' 539 || libraryName == 'dart:html_common'
541 || libraryName == 'dart:indexed_db' 540 || libraryName == 'dart:indexed_db'
542 || libraryName == 'dart:svg' 541 || libraryName == 'dart:svg'
543 || libraryName == 'dart:web_audio') { 542 || libraryName == 'dart:web_audio'
543 || libraryName == 'dart:mirrors') {
ahe 2012/12/19 10:37:57 Perhaps you shouldn't move this line.
544 if (nativeTest 544 if (nativeTest
545 || libraryName == 'dart:html' 545 || libraryName == 'dart:html'
546 || libraryName == 'dart:html_common' 546 || libraryName == 'dart:html_common'
547 || libraryName == 'dart:indexed_db' 547 || libraryName == 'dart:indexed_db'
548 || libraryName == 'dart:svg' 548 || libraryName == 'dart:svg') {
549 || libraryName == 'dart:mirrors') {
550 // dart:html and dart:svg need access to convertDartClosureToJS and 549 // dart:html and dart:svg need access to convertDartClosureToJS and
551 // annotation classes. 550 // annotation classes.
552 // dart:mirrors needs access to the Primitives class. 551 // dart:mirrors needs access to the Primitives class.
553 importHelperLibrary(library); 552 importHelperLibrary(library);
554 } 553 }
555 library.addToScope( 554 library.addToScope(
556 foreignLibrary.findLocal(const SourceString('JS')), this); 555 foreignLibrary.findLocal(const SourceString('JS')), this);
557 Element jsIndexingBehaviorInterface = 556 Element jsIndexingBehaviorInterface =
558 findHelper(const SourceString('JavaScriptIndexingBehavior')); 557 findHelper(const SourceString('JavaScriptIndexingBehavior'));
559 if (jsIndexingBehaviorInterface != null) { 558 if (jsIndexingBehaviorInterface != null) {
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 // TODO(johnniwinther): Use [spannable] and [message] to provide better 975 // TODO(johnniwinther): Use [spannable] and [message] to provide better
977 // information on assertion errors. 976 // information on assertion errors.
978 if (condition is Function){ 977 if (condition is Function){
979 condition = condition(); 978 condition = condition();
980 } 979 }
981 if (spannable == null || !condition) { 980 if (spannable == null || !condition) {
982 throw new SpannableAssertionFailure(spannable, message); 981 throw new SpannableAssertionFailure(spannable, message);
983 } 982 }
984 return true; 983 return true;
985 } 984 }
OLDNEW
« no previous file with comments | « runtime/lib/mirrors_sources.gypi ('k') | sdk/lib/_internal/compiler/implementation/lib/mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698