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

Unified Diff: pkg/compiler/lib/src/universe/selector.dart

Issue 1346093003: Revert "Add optional message to assert in Dart2js - continued" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/typechecker.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/universe/selector.dart
diff --git a/pkg/compiler/lib/src/universe/selector.dart b/pkg/compiler/lib/src/universe/selector.dart
index 7e0981b6508dcece0d430fc66957c03ee4d4892d..e183a58f8d771ef3e001edaf4cede251ddc6a2e9 100644
--- a/pkg/compiler/lib/src/universe/selector.dart
+++ b/pkg/compiler/lib/src/universe/selector.dart
@@ -200,6 +200,9 @@ class Selector {
bool get isOperator => kind == SelectorKind.OPERATOR;
bool get isUnaryOperator => isOperator && argumentCount == 0;
+ /** Check whether this is a call to 'assert'. */
+ bool get isAssert => isCall && identical(name, "assert");
+
/**
* The member name for invocation mirrors created from this selector.
*/
@@ -252,7 +255,9 @@ class Selector {
bool sameNameHack(Element element, World world) {
// TODO(ngeoffray): Remove workaround checks.
- return element.isConstructor || name == element.name;
+ return element.isConstructor ||
+ name == element.name ||
+ name == 'assert' && world.isAssertMethod(element);
}
bool applies(Element element, World world) {
« no previous file with comments | « pkg/compiler/lib/src/typechecker.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698