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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.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/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/parser/listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 4273279bc712c7409c1dbd7845217dc98d7adff7..bb884785efd6b07c9a319717734fd026242499d7 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -278,9 +278,7 @@ class JavaScriptBackend extends Backend {
ClassElement closureClass;
ClassElement boundClosureClass;
- Element assertTestMethod;
- Element assertThrowMethod;
- Element assertHelperMethod;
+ Element assertMethod;
Element invokeOnMethod;
ClassElement jsInterceptorClass;
@@ -1359,6 +1357,8 @@ class JavaScriptBackend extends Backend {
}
}
+ bool isAssertMethod(Element element) => element == assertMethod;
+
void registerRequiredType(DartType type, Element enclosingElement) {
// If [argument] has type variables or is a type variable, this method
// registers a RTI dependency between the class where the type variable is
@@ -2121,9 +2121,7 @@ class JavaScriptBackend extends Backend {
jsMutableIndexableClass = findClass('JSMutableIndexable');
} else if (uri == DART_JS_HELPER) {
initializeHelperClasses();
- assertTestMethod = findHelper('assertTest');
- assertThrowMethod = findHelper('assertThrow');
- assertHelperMethod = findHelper('assertHelper');
+ assertMethod = findHelper('assertHelper');
typeLiteralClass = findClass('TypeImpl');
constMapLiteralClass = findClass('ConstantMap');
@@ -2923,13 +2921,8 @@ class JavaScriptResolutionCallbacks extends ResolutionCallbacks {
registry.registerInstantiation(element.rawType);
}
- void onAssert(bool hasMessage, Registry registry) {
- if (hasMessage) {
- registerBackendStaticInvocation(backend.assertTestMethod, registry);
- registerBackendStaticInvocation(backend.assertThrowMethod, registry);
- } else {
- registerBackendStaticInvocation(backend.assertHelperMethod, registry);
- }
+ void onAssert(Send node, Registry registry) {
+ registerBackendStaticInvocation(backend.assertMethod, registry);
}
void onAsyncForIn(AsyncForIn node, Registry registry) {
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/parser/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698