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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 19754002: Rewrite how we handle synthesized constructors in the compiler. This was motivated by issue https:/… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
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) {

Powered by Google App Engine
This is Rietveld 408576698