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

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

Issue 2092913004: Skip unresolved functions in NoSuchMethodRegistry (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 | « no previous file | tests/compiler/dart2js/serialization/test_data.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/no_such_method_registry.dart
diff --git a/pkg/compiler/lib/src/js_backend/no_such_method_registry.dart b/pkg/compiler/lib/src/js_backend/no_such_method_registry.dart
index 4cbc011d7dfe48394a5830a0cd8db570f9fc4a5c..d9e8681f376d767a38a48593e47d334e3e3872cf 100644
--- a/pkg/compiler/lib/src/js_backend/no_such_method_registry.dart
+++ b/pkg/compiler/lib/src/js_backend/no_such_method_registry.dart
@@ -193,8 +193,16 @@ class NoSuchMethodRegistry {
// At this point we know that this is signature-compatible with
// Object.noSuchMethod, but it may have more than one argument as long as
// it only has one required argument.
+ if (!element.hasResolvedAst) {
+ // TODO(johnniwinther): Why do we see unresolved elements here?
+ return false;
+ }
+ ResolvedAst resolvedAst = element.resolvedAst;
+ if (resolvedAst.kind != ResolvedAstKind.PARSED) {
+ return false;
+ }
String param = element.parameters.first.name;
- Statement body = element.node.body;
+ Statement body = resolvedAst.body;
Expression expr;
if (body is Return && body.isArrowBody) {
expr = body.expression;
@@ -231,7 +239,15 @@ class NoSuchMethodRegistry {
}
bool _hasThrowingSyntax(FunctionElement element) {
- Statement body = element.node.body;
+ if (!element.hasResolvedAst) {
+ // TODO(johnniwinther): Why do we see unresolved elements here?
+ return false;
+ }
+ ResolvedAst resolvedAst = element.resolvedAst;
+ if (resolvedAst.kind != ResolvedAstKind.PARSED) {
+ return false;
+ }
+ Statement body = resolvedAst.body;
if (body is Return && body.isArrowBody) {
if (body.expression is Throw) {
return true;
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698