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

Side by Side Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 1257513002: dart2js: fix crash when annotations have syntax errors (fix #23983) (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/scanner/listener.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.compile_time_constant_evaluator; 5 library dart2js.compile_time_constant_evaluator;
6 6
7 import 'constant_system_dart.dart'; 7 import 'constant_system_dart.dart';
8 import 'constants/constant_system.dart'; 8 import 'constants/constant_system.dart';
9 import 'constants/expressions.dart'; 9 import 'constants/expressions.dart';
10 import 'constants/values.dart'; 10 import 'constants/values.dart';
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 CompileTimeConstantEvaluator(this.handler, 330 CompileTimeConstantEvaluator(this.handler,
331 this.elements, 331 this.elements,
332 this.compiler, 332 this.compiler,
333 {bool isConst: false}) 333 {bool isConst: false})
334 : this.isEvaluatingConstant = isConst; 334 : this.isEvaluatingConstant = isConst;
335 335
336 ConstantSystem get constantSystem => handler.constantSystem; 336 ConstantSystem get constantSystem => handler.constantSystem;
337 337
338 AstConstant evaluate(Node node) { 338 AstConstant evaluate(Node node) {
339 // TODO(johnniwinter): should there be a visitErrorNode?
Johnni Winther 2015/07/27 07:57:05 'johnniwinter' -> 'johnniwinther' (but kudos for g
Siggi Cherem (dart-lang) 2015/07/27 16:26:44 Oh thanks for letting me know :) I forgot to inc
340 if (node is ErrorNode) return new ErroneousAstConstant(context, node);
339 return node.accept(this); 341 return node.accept(this);
340 } 342 }
341 343
342 AstConstant evaluateConstant(Node node) { 344 AstConstant evaluateConstant(Node node) {
343 bool oldIsEvaluatingConstant = isEvaluatingConstant; 345 bool oldIsEvaluatingConstant = isEvaluatingConstant;
344 isEvaluatingConstant = true; 346 isEvaluatingConstant = true;
345 AstConstant result = node.accept(this); 347 AstConstant result = node.accept(this);
346 isEvaluatingConstant = oldIsEvaluatingConstant; 348 isEvaluatingConstant = oldIsEvaluatingConstant;
347 assert(result != null); 349 assert(result != null);
348 return result; 350 return result;
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 // TODO(johnniwinther): Return a [NonConstantValue] instead. 1335 // TODO(johnniwinther): Return a [NonConstantValue] instead.
1334 new ErroneousConstantExpression(), new NullConstantValue()); 1336 new ErroneousConstantExpression(), new NullConstantValue());
1335 } 1337 }
1336 1338
1337 // TODO(johnniwinther): Avoid the need for this hack. 1339 // TODO(johnniwinther): Avoid the need for this hack.
1338 TreeElements _analyzeElementEagerly(Compiler compiler, AstElement element) { 1340 TreeElements _analyzeElementEagerly(Compiler compiler, AstElement element) {
1339 WorldImpact worldImpact = compiler.analyzeElement(element.declaration); 1341 WorldImpact worldImpact = compiler.analyzeElement(element.declaration);
1340 compiler.enqueuer.resolution.applyImpact(element.declaration, worldImpact); 1342 compiler.enqueuer.resolution.applyImpact(element.declaration, worldImpact);
1341 return element.resolvedAst.elements; 1343 return element.resolvedAst.elements;
1342 } 1344 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698