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

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: Renamed Assert to assertHelper. Switched parser to use parseArguments. Added assert argument checki… 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 // The core and coreimpl libraries were loaded and patched before 381 // The core and coreimpl libraries were loaded and patched before
382 // jsHelperLibrary was initialized, so it wasn't imported into those 382 // jsHelperLibrary was initialized, so it wasn't imported into those
383 // two libraries during patching. 383 // two libraries during patching.
384 importHelperLibrary(coreLibrary); 384 importHelperLibrary(coreLibrary);
385 importHelperLibrary(coreImplLibrary); 385 importHelperLibrary(coreImplLibrary);
386 importHelperLibrary(interceptorsLibrary); 386 importHelperLibrary(interceptorsLibrary);
387 387
388 addForeignFunctions(jsHelperLibrary); 388 addForeignFunctions(jsHelperLibrary);
389 addForeignFunctions(interceptorsLibrary); 389 addForeignFunctions(interceptorsLibrary);
390 390
391 assertMethod = jsHelperLibrary.find(const SourceString('assert')); 391 assertMethod = jsHelperLibrary.find(const SourceString('assertHelper'));
392 identicalFunction = coreLibrary.find(const SourceString('identical')); 392 identicalFunction = coreLibrary.find(const SourceString('identical'));
393 393
394 initializeSpecialClasses(); 394 initializeSpecialClasses();
395 395
396 functionClass.ensureResolved(this); 396 functionClass.ensureResolved(this);
397 functionApplyMethod = 397 functionApplyMethod =
398 functionClass.lookupLocalMember(const SourceString('apply')); 398 functionClass.lookupLocalMember(const SourceString('apply'));
399 } 399 }
400 400
401 void loadCoreImplLibrary() { 401 void loadCoreImplLibrary() {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 // TODO(johnniwinther): Use [spannable] and [message] to provide better 846 // TODO(johnniwinther): Use [spannable] and [message] to provide better
847 // information on assertion errors. 847 // information on assertion errors.
848 if (condition is Function){ 848 if (condition is Function){
849 condition = condition(); 849 condition = condition();
850 } 850 }
851 if (!condition && message != null) { 851 if (!condition && message != null) {
852 print('assertion failed: $message'); 852 print('assertion failed: $message');
853 } 853 }
854 return spannable != null && condition; 854 return spannable != null && condition;
855 } 855 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/lib/js_helper.dart » ('j') | lib/compiler/implementation/universe/universe.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698