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

Unified Diff: pkg/compiler/lib/src/kernel/element_map_impl.dart

Issue 2984783002: Fix and assert getLocalFunction invariant (Closed)
Patch Set: Created 3 years, 5 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/js_model/closure.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/element_map_impl.dart
diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart
index c08b5f6030a563b28fe19db3d81504653bde6d24..642806795aac7108b8ac6ded81471beac1f0d485 100644
--- a/pkg/compiler/lib/src/kernel/element_map_impl.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart
@@ -896,6 +896,10 @@ abstract class ElementCreatorMixin {
}
Local _getLocalFunction(ir.TreeNode node) {
+ assert(
+ node is ir.FunctionDeclaration || node is ir.FunctionExpression,
+ failedAt(
+ CURRENT_ELEMENT_SPANNABLE, 'Invalid local function node: $node'));
return _localFunctionMap.putIfAbsent(node, () {
MemberEntity memberContext;
Entity executableContext;
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698