Chromium Code Reviews| Index: dart/frog/leg/frog_leg.dart |
| diff --git a/dart/frog/leg/frog_leg.dart b/dart/frog/leg/frog_leg.dart |
| index 646e95bee362f4ec64b53b7ac466014270fbdaa7..b1228b68ec4a561cb597f6f529a15e3a0954679d 100644 |
| --- a/dart/frog/leg/frog_leg.dart |
| +++ b/dart/frog/leg/frog_leg.dart |
| @@ -117,8 +117,13 @@ class WorldCompiler extends Compiler { |
| element = element.enclosingElement; |
| // TODO(ahe): I plan to overhaul this infrastructure anyways. |
| } |
| - withCurrentElement(element, |
| - () => cancel(reason: reason, token: element.position())); |
| + if (element !== null) { |
| + withCurrentElement(element, |
| + () => cancel(reason: reason, token: element.position())); |
| + } |
| + } else if (currentElement !== null) { |
| + cancel(reason, element: currentElement); |
| + return; |
|
kasperl
2012/02/21 07:23:30
We usually do not return after a cancel.
|
| } |
| if (throwOnError) { |
| throw new AbortLeg(reason); |