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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1167353003: Opt-in to generate code for compile-time error. Only supported for SSA. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/deferred_load.dart ('k') | tests/compiler/dart2js/analyze_only_test.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 ce403ad44d6edb0b5f439f11c65f0e5d20c06de4..70ecdc2bacc59f8e20a14b893beb185a97203106 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -608,8 +608,6 @@ class JavaScriptBackend extends Backend {
PatchResolverTask patchResolverTask;
- bool get canHandleCompilationFailed => true;
-
bool enabledNoSuchMethod = false;
JavaScriptBackend(Compiler compiler,
@@ -2679,10 +2677,23 @@ class JavaScriptBackend extends Backend {
}
@override
- bool registerDeferredLoading(Spannable node, Registry registry) {
+ bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) {
registerCheckDeferredIsLoaded(registry);
return true;
}
+
+ @override
+ bool enableCodegenWithErrorsIfSupported(Spannable node) {
+ if (compiler.useCpsIr) {
+ compiler.reportHint(
+ node,
+ MessageKind.GENERIC,
+ {'text': "Generation of code with compile time errors is currently "
+ "not supported with the CPS IR."});
+ return false;
+ }
+ return true;
+ }
}
/// Handling of special annotations for tests.
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | tests/compiler/dart2js/analyze_only_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698