Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 /// Holds a couple utility functions used at various places in the system. | 5 /// Holds a couple utility functions used at various places in the system. |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'package:path/path.dart' as path; | 8 import 'package:path/path.dart' as path; |
| 9 import 'package:analyzer/src/generated/ast.dart' | 9 import 'package:analyzer/dart/ast/ast.dart' |
| 10 show | 10 show |
| 11 ImportDirective, | 11 ImportDirective, |
| 12 ExportDirective, | 12 ExportDirective, |
| 13 PartDirective, | 13 PartDirective, |
| 14 CompilationUnit, | 14 CompilationUnit, |
| 15 Identifier, | 15 Identifier, |
| 16 AnnotatedNode, | 16 AnnotatedNode, |
| 17 AstNode, | 17 AstNode, |
| 18 Expression, | 18 Expression, |
| 19 SimpleIdentifier, | 19 SimpleIdentifier, |
| 20 MethodInvocation; | 20 MethodInvocation; |
| 21 import 'package:analyzer/dart/element/element.dart'; | |
| 22 import 'package:analyzer/dart/element/type.dart'; | |
| 21 import 'package:analyzer/src/generated/constant.dart' show DartObject; | 23 import 'package:analyzer/src/generated/constant.dart' show DartObject; |
| 22 import 'package:analyzer/src/generated/element.dart'; | 24 //TODO(leafp): Remove deprecated dependency |
| 25 //ignore: DEPRECATED_MEMBER_USE | |
|
Jennifer Messerly
2016/03/14 23:12:42
oh, I was confused because it didn't look deprecat
Leaf
2016/03/14 23:58:42
src/generated/element.dart is deprecated. I can m
| |
| 26 import 'package:analyzer/src/generated/element.dart' show DynamicTypeImpl; | |
| 23 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 27 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
| 24 import 'package:analyzer/src/generated/error.dart' show ErrorCode; | 28 import 'package:analyzer/src/generated/error.dart' show ErrorCode; |
| 25 import 'package:analyzer/src/task/dart.dart' show ParseDartTask; | 29 import 'package:analyzer/src/task/dart.dart' show ParseDartTask; |
| 26 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; | 30 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; |
| 27 import 'package:analyzer/src/generated/source.dart' show LineInfo, Source; | 31 import 'package:analyzer/src/generated/source.dart' show LineInfo, Source; |
| 28 import 'package:analyzer/analyzer.dart' show parseDirectives; | 32 import 'package:analyzer/analyzer.dart' show parseDirectives; |
| 29 import 'package:crypto/crypto.dart' show CryptoUtils, MD5; | 33 import 'package:crypto/crypto.dart' show CryptoUtils, MD5; |
| 30 import 'package:source_span/source_span.dart'; | 34 import 'package:source_span/source_span.dart'; |
| 31 | 35 |
| 32 import 'codegen/js_names.dart' show invalidVariableName; | 36 import 'codegen/js_names.dart' show invalidVariableName; |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 466 new File(source).copySync(destination); | 470 new File(source).copySync(destination); |
| 467 } | 471 } |
| 468 | 472 |
| 469 void writeAsStringSync(String file, String contents) { | 473 void writeAsStringSync(String file, String contents) { |
| 470 _ensureParentExists(file); | 474 _ensureParentExists(file); |
| 471 new File(file).writeAsStringSync(contents); | 475 new File(file).writeAsStringSync(contents); |
| 472 } | 476 } |
| 473 } | 477 } |
| 474 | 478 |
| 475 DartType getStaticType(Expression e) => | 479 DartType getStaticType(Expression e) => |
| 476 e.staticType ?? DynamicTypeImpl.instance; | 480 e.staticType ?? DynamicTypeImpl.instance; |
|
Leaf
2016/03/14 22:47:55
We rely in places on being able to just get the ca
Jennifer Messerly
2016/03/14 23:12:42
Is there a reason? I'd prefer to use the well know
Leaf
2016/03/14 23:58:42
I think it's just a question about the analyzer AP
Brian Wilkerson
2016/03/15 00:14:16
That does sound suspicious, and we should look int
| |
| 477 | 481 |
| 478 // TODO(leafp) Factor this out or use an existing library | 482 // TODO(leafp) Factor this out or use an existing library |
| 479 class Tuple2<T0, T1> { | 483 class Tuple2<T0, T1> { |
| 480 final T0 e0; | 484 final T0 e0; |
| 481 final T1 e1; | 485 final T1 e1; |
| 482 Tuple2(this.e0, this.e1); | 486 Tuple2(this.e0, this.e1); |
| 483 } | 487 } |
| OLD | NEW |