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

Side by Side Diff: pkg/compiler/lib/src/world.dart

Issue 1325843003: Add optional message to assert in Dart2js. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Reintroduce assertHelper for asserts without messages. Created 5 years, 3 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
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 library dart2js.world; 5 library dart2js.world;
6 6
7 import 'closure.dart' show 7 import 'closure.dart' show
8 SynthesizedCallMethodElementX; 8 SynthesizedCallMethodElementX;
9 import 'common/backend_api.dart' show 9 import 'common/backend_api.dart' show
10 Backend; 10 Backend;
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 final Set<Element> elementsThatCannotThrow = new Set<Element>(); 353 final Set<Element> elementsThatCannotThrow = new Set<Element>();
354 354
355 final Set<Element> functionsThatMightBePassedToApply = 355 final Set<Element> functionsThatMightBePassedToApply =
356 new Set<FunctionElement>(); 356 new Set<FunctionElement>();
357 357
358 final Set<Element> alreadyPopulated; 358 final Set<Element> alreadyPopulated;
359 359
360 bool get isClosed => compiler.phase > Compiler.PHASE_RESOLVING; 360 bool get isClosed => compiler.phase > Compiler.PHASE_RESOLVING;
361 361
362 // Used by selectors. 362 // Used by selectors.
363 bool isAssertMethod(Element element) {
364 return compiler.backend.isAssertMethod(element);
365 }
366
367 // Used by selectors.
368 bool isForeign(Element element) { 363 bool isForeign(Element element) {
369 return compiler.backend.isForeign(element); 364 return compiler.backend.isForeign(element);
370 } 365 }
371 366
372 Set<ClassElement> typesImplementedBySubclassesOf(ClassElement cls) { 367 Set<ClassElement> typesImplementedBySubclassesOf(ClassElement cls) {
373 return _typesImplementedBySubclasses[cls.declaration]; 368 return _typesImplementedBySubclasses[cls.declaration];
374 } 369 }
375 370
376 World(Compiler compiler) 371 World(Compiler compiler)
377 : allFunctions = new FunctionSet(compiler), 372 : allFunctions = new FunctionSet(compiler),
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 // function expressions's element. 622 // function expressions's element.
628 // TODO(herhut): Generate classes for function expressions earlier. 623 // TODO(herhut): Generate classes for function expressions earlier.
629 if (element is SynthesizedCallMethodElementX) { 624 if (element is SynthesizedCallMethodElementX) {
630 return getMightBePassedToApply(element.expression); 625 return getMightBePassedToApply(element.expression);
631 } 626 }
632 return functionsThatMightBePassedToApply.contains(element); 627 return functionsThatMightBePassedToApply.contains(element);
633 } 628 }
634 629
635 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; 630 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport;
636 } 631 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698