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

Side by Side Diff: lib/src/codegen/nullability_inferrer.dart

Issue 1710583002: Fix tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Fix hints and reformat Created 4 years, 10 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 | « lib/src/codegen/js_codegen.dart ('k') | test/browser/language_tests.js » ('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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dev_compiler.src.codegen.nullability_inferrer; 5 library dev_compiler.src.codegen.nullability_inferrer;
6 6
7 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; 7 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
8 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; 8 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator;
9 import 'package:analyzer/src/generated/element.dart'; 9 import 'package:analyzer/src/generated/element.dart';
10 import 'package:analyzer/src/generated/scanner.dart' 10 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType;
11 show StringToken, Token, TokenType;
12 11
13 import 'assignments_index.dart'; 12 import 'assignments_index.dart';
14 import 'js_codegen.dart' show TemporaryVariableElement; 13 import 'js_codegen.dart' show TemporaryVariableElement;
15 import '../utils.dart' show isInlineJS, DirectedGraph; 14 import '../utils.dart' show isInlineJS, DirectedGraph;
16 15
17 typedef bool NullableExpressionPredicate(Expression expr); 16 typedef bool NullableExpressionPredicate(Expression expr);
18 17
19 typedef DartType _StaticTypeGetter(Expression e); 18 typedef DartType _StaticTypeGetter(Expression e);
20 typedef bool _JSBuiltinTypePredicate(DartType t); 19 typedef bool _JSBuiltinTypePredicate(DartType t);
21 20
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 }); 155 });
157 var nullables = assignmentsGraph.getTransitiveClosure(trivialNullables); 156 var nullables = assignmentsGraph.getTransitiveClosure(trivialNullables);
158 157
159 bool isNullableLocal(LocalVariableElement e) { 158 bool isNullableLocal(LocalVariableElement e) {
160 // TODO(jmesserly): we should be able to make this work for temps too. 159 // TODO(jmesserly): we should be able to make this work for temps too.
161 return e is TemporaryVariableElement || nullables.contains(e); 160 return e is TemporaryVariableElement || nullables.contains(e);
162 } 161 }
163 return (Expression expr) => _isNullableExpression(expr, isNullableLocal); 162 return (Expression expr) => _isNullableExpression(expr, isNullableLocal);
164 } 163 }
165 } 164 }
OLDNEW
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698