Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
=================================================================== |
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 25107) |
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy) |
@@ -18,12 +18,16 @@ |
js.Fun buildJavaScriptFunction(FunctionElement element, |
List<js.Parameter> parameters, |
js.Block body) { |
- FunctionExpression expression = |
- element.implementation.parseNode(backend.compiler); |
js.Fun result = new js.Fun(parameters, body); |
// TODO(johnniwinther): remove the 'element.patch' hack. |
Element sourceElement = element.patch == null ? element : element.patch; |
SourceFile sourceFile = sourceElement.getCompilationUnit().script.file; |
+ Node expression = |
+ element.implementation.parseNode(backend.compiler); |
+ if (expression == null) { |
+ // Synthesized node. Use the enclosing element for the location. |
+ expression = element.enclosingElement.parseNode(backend.compiler); |
ahe
2013/07/18 09:59:32
I'm not sure about this. I'll suggest an alternati
ahe
2013/07/18 14:32:56
Spannable spannable = element.implementation.parse
ngeoffray
2013/07/18 15:25:14
Done.
|
+ } |
// TODO(podivilov): find the right sourceFile here and remove offset checks |
// below. |
if (expression.getBeginToken().charOffset < sourceFile.text.length) { |