Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 /// Set of flags and options passed to the compiler | 5 /// Set of flags and options passed to the compiler |
| 6 library dev_compiler.src.options; | 6 library dev_compiler.src.options; |
| 7 | 7 |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 /// We can infer the type of `A` based on the type of `B`. The current | 37 /// We can infer the type of `A` based on the type of `B`. The current |
| 38 /// implementation of this inference is limited to ensure the answer is | 38 /// implementation of this inference is limited to ensure the answer is |
| 39 /// deterministic when applying inference on library cycles. In the example | 39 /// deterministic when applying inference on library cycles. In the example |
| 40 /// above, `A` is inferred to have `B`'s declared type if they are both in the | 40 /// above, `A` is inferred to have `B`'s declared type if they are both in the |
| 41 /// same library cycle. However, if `B`'s definition is not in the same | 41 /// same library cycle. However, if `B`'s definition is not in the same |
| 42 /// connected component as `A`, we use `B`'s inferred type instead. | 42 /// connected component as `A`, we use `B`'s inferred type instead. |
| 43 /// | 43 /// |
| 44 /// Because this might be surprising to users, this is turned off by default. | 44 /// Because this might be surprising to users, this is turned off by default. |
| 45 /// In the future, inference might track dependencies between variables in | 45 /// In the future, inference might track dependencies between variables in |
| 46 /// more detail so that, in the example above, we can use `B`'s inferred type | 46 /// more detail so that, in the example above, we can use `B`'s inferred type |
| 47 /// always. | 47 /// always. |
|
vsm
2015/03/21 15:52:19
Can you update the comment? :-)
Have you seen an
Siggi Cherem (dart-lang)
2015/03/23 20:06:31
Good point. done.
| |
| 48 final bool inferTransitively; | 48 final bool inferTransitively; |
| 49 static const inferTransitivelyDefault = false; | 49 static const inferTransitivelyDefault = true; |
| 50 | 50 |
| 51 /// Restrict inference of fields and top-levels to those that are final and | 51 /// Restrict inference of fields and top-levels to those that are final and |
| 52 /// const. | 52 /// const. |
| 53 final bool onlyInferConstsAndFinalFields; | 53 final bool onlyInferConstsAndFinalFields; |
| 54 static const onlyInferConstAndFinalFieldsDefault = false; | 54 static const onlyInferConstAndFinalFieldsDefault = false; |
| 55 | 55 |
| 56 ResolverOptions({this.useMultiPackage: false, this.packageRoot: 'packages/', | 56 ResolverOptions({this.useMultiPackage: false, this.packageRoot: 'packages/', |
| 57 this.packagePaths: const <String>[], | 57 this.packagePaths: const <String>[], |
| 58 this.inferFromOverrides: inferFromOverridesDefault, | 58 this.inferFromOverrides: inferFromOverridesDefault, |
| 59 this.inferTransitively: inferTransitivelyDefault, | 59 this.inferTransitively: inferTransitivelyDefault, |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 // The pub-cache directory is two levels up, but we verify that the layout | 395 // The pub-cache directory is two levels up, but we verify that the layout |
| 396 // looks correct. | 396 // looks correct. |
| 397 if (path.basename(dir) != 'dev_compiler') return null; | 397 if (path.basename(dir) != 'dev_compiler') return null; |
| 398 dir = path.dirname(dir); | 398 dir = path.dirname(dir); |
| 399 if (path.basename(dir) != 'global_packages') return null; | 399 if (path.basename(dir) != 'global_packages') return null; |
| 400 dir = path.dirname(dir); | 400 dir = path.dirname(dir); |
| 401 return path.join(dir, cacheDir, 'lib', 'runtime'); | 401 return path.join(dir, cacheDir, 'lib', 'runtime'); |
| 402 } | 402 } |
| 403 return null; | 403 return null; |
| 404 } | 404 } |
| OLD | NEW |