Index: pkg/compiler/lib/src/ssa/builder.dart |
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart |
index 6021ffcbecdb4207af86a1ec257d66a322da61fe..83d75805d34a78e33cae4ac2628a65d9ca4cf8ec 100644 |
--- a/pkg/compiler/lib/src/ssa/builder.dart |
+++ b/pkg/compiler/lib/src/ssa/builder.dart |
@@ -3613,6 +3613,17 @@ class SsaBuilder extends ast.Visitor |
stack.add(value); |
} |
+ void generateNoSuchSetter(ast.Node location, |
+ Element element, |
+ HInstruction value) { |
+ List<HInstruction> arguments = |
+ value == null ? const <HInstruction>[] : <HInstruction>[value]; |
+ // An erroneous element indicates an unresolved static setter. |
+ generateThrowNoSuchMethod( |
+ location, noSuchMethodTargetSymbolString(element, 'set'), |
+ argumentValues: arguments); |
+ } |
+ |
void generateNonInstanceSetter(ast.SendSet send, |
Element element, |
HInstruction value, |
@@ -3634,12 +3645,7 @@ class SsaBuilder extends ast.Visitor |
stack.add(value); |
} else if (Elements.isErroneous(element)) { |
if (element is ErroneousElement) { |
- List<HInstruction> arguments = |
- send == null ? const <HInstruction>[] : <HInstruction>[value]; |
- // An erroneous element indicates an unresolved static setter. |
- generateThrowNoSuchMethod( |
- location, noSuchMethodTargetSymbolString(element, 'set'), |
- argumentValues: arguments); |
+ generateNoSuchSetter(location, element, send == null ? null : value); |
} else { |
// TODO(ahe): Do something like [generateWrongArgumentCountError]. |
stack.add(graph.addConstantNull(compiler)); |
@@ -6462,7 +6468,7 @@ class SsaBuilder extends ast.Visitor |
ast.Node rhs, |
_) { |
generateIsDeferredLoadedCheckOfSend(node); |
- generateNonInstanceSetter(node, getter, visitAndPop(rhs)); |
+ generateNoSuchSetter(node, getter, visitAndPop(rhs)); |
} |
@override |
@@ -6482,7 +6488,7 @@ class SsaBuilder extends ast.Visitor |
ast.Node rhs, |
_) { |
generateIsDeferredLoadedCheckOfSend(node); |
- generateNonInstanceSetter(node, function, visitAndPop(rhs)); |
+ generateNoSuchSetter(node, function, visitAndPop(rhs)); |
} |
@override |
@@ -6512,7 +6518,7 @@ class SsaBuilder extends ast.Visitor |
ast.Node rhs, |
_) { |
generateIsDeferredLoadedCheckOfSend(node); |
- generateNonInstanceSetter(node, getter, visitAndPop(rhs)); |
+ generateNoSuchSetter(node, getter, visitAndPop(rhs)); |
} |
@override |
@@ -6532,7 +6538,7 @@ class SsaBuilder extends ast.Visitor |
ast.Node rhs, |
_) { |
generateIsDeferredLoadedCheckOfSend(node); |
- generateNonInstanceSetter(node, function, visitAndPop(rhs)); |
+ generateNoSuchSetter(node, function, visitAndPop(rhs)); |
} |
@override |