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

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

Issue 11014010: Made assert a keyword. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months 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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 const bool REPORT_EXCESS_RESOLUTION = false; 10 const bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 coreImplLibrary = scanBuiltinLibrary('coreimpl'); 364 coreImplLibrary = scanBuiltinLibrary('coreimpl');
365 jsHelperLibrary = scanBuiltinLibrary('_js_helper'); 365 jsHelperLibrary = scanBuiltinLibrary('_js_helper');
366 interceptorsLibrary = scanBuiltinLibrary('_interceptors'); 366 interceptorsLibrary = scanBuiltinLibrary('_interceptors');
367 367
368 addForeignFunctions(jsHelperLibrary); 368 addForeignFunctions(jsHelperLibrary);
369 addForeignFunctions(interceptorsLibrary); 369 addForeignFunctions(interceptorsLibrary);
370 370
371 libraries['dart:core'] = coreLibrary; 371 libraries['dart:core'] = coreLibrary;
372 libraries['dart:coreimpl'] = coreImplLibrary; 372 libraries['dart:coreimpl'] = coreImplLibrary;
373 373
374 assertMethod = jsHelperLibrary.find(const SourceString('assert')); 374 assertMethod = jsHelperLibrary.find(const SourceString('Assert'));
ahe 2012/10/10 08:44:13 I think I would prefer calling this "assertHelper"
aam-me 2012/10/11 05:35:25 Done.
375 identicalFunction = coreLibrary.find(const SourceString('identical')); 375 identicalFunction = coreLibrary.find(const SourceString('identical'));
376 376
377 initializeSpecialClasses(); 377 initializeSpecialClasses();
378 } 378 }
379 379
380 void importCoreLibrary(LibraryElement library) { 380 void importCoreLibrary(LibraryElement library) {
381 Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core'); 381 Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core');
382 if (coreLibrary === null) { 382 if (coreLibrary === null) {
383 coreLibrary = scanner.loadLibrary(coreUri, null, coreUri); 383 coreLibrary = scanner.loadLibrary(coreUri, null, coreUri);
384 } 384 }
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 * information in the generated error message. 948 * information in the generated error message.
949 */ 949 */
950 bool invariant(Spannable spannable, var condition, {String message: null}) { 950 bool invariant(Spannable spannable, var condition, {String message: null}) {
951 // TODO(johnniwinther): Use [spannable] and [message] to provide better 951 // TODO(johnniwinther): Use [spannable] and [message] to provide better
952 // information on assertion errors. 952 // information on assertion errors.
953 if (condition is Function){ 953 if (condition is Function){
954 condition = condition(); 954 condition = condition();
955 } 955 }
956 return spannable != null && condition; 956 return spannable != null && condition;
957 } 957 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/lib/js_helper.dart » ('j') | lib/compiler/implementation/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698