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 library dart2js.cmdline.options; | 5 library dart2js.cmdline.options; |
6 | 6 |
7 /// Commandline flags used in `dart2js.dart` and/or `apiimpl.dart`. | 7 /// Commandline flags used in `dart2js.dart` and/or `apiimpl.dart`. |
8 class Flags { | 8 class Flags { |
9 static const String allowMockCompilation = '--allow-mock-compilation'; | 9 static const String allowMockCompilation = '--allow-mock-compilation'; |
10 static const String allowNativeExtensions = '--allow-native-extensions'; | 10 static const String allowNativeExtensions = '--allow-native-extensions'; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 static const String trustJSInteropTypeAnnotations = | 44 static const String trustJSInteropTypeAnnotations = |
45 '--experimental-trust-js-interop-type-annotations'; | 45 '--experimental-trust-js-interop-type-annotations'; |
46 static const String useContentSecurityPolicy = '--csp'; | 46 static const String useContentSecurityPolicy = '--csp'; |
47 static const String useKernel = '--use-kernel'; | 47 static const String useKernel = '--use-kernel'; |
48 static const String useNewSourceInfo = '--use-new-source-info'; | 48 static const String useNewSourceInfo = '--use-new-source-info'; |
49 static const String verbose = '--verbose'; | 49 static const String verbose = '--verbose'; |
50 static const String version = '--version'; | 50 static const String version = '--version'; |
51 | 51 |
52 static const String conditionalDirectives = '--conditional-directives'; | 52 static const String conditionalDirectives = '--conditional-directives'; |
53 | 53 |
54 // The syntax-only level of support for generic methods is included in the | 54 // Experimental flags. |
55 // 1.50 milestone for Dart. It is not experimental, but also not permanent: | 55 |
56 // a full implementation is expected in the future. Hence, the | 56 // Considerations about this feature (esp. locations where generalizations |
57 // 'GENERIC_METHODS' comments which were added when this feature was | 57 // or changes are required for full support of generic methods) are marked |
58 // experimental have been preserved, such that it will be easy to find the | 58 // with 'GENERIC_METHODS'. The approach taken is to parse generic methods, |
59 // relevant locations to update when generic methods are implemented fully. | |
60 // | |
61 // The option is still accepted, but it has no effect: The feature is enabled | |
62 // by default and it cannot be disabled. | |
63 // | |
64 // The approach taken in the implementation is to parse generic methods, | |
65 // introduce AST nodes for them, generate corresponding types (such that | 59 // introduce AST nodes for them, generate corresponding types (such that |
66 // front end treatment is consistent with the code that programmers wrote), | 60 // front end treatment is consistent with the code that programmers wrote), |
67 // but considering all method type variables to have bound `dynamic` no | 61 // but considering all method type variables to have bound `dynamic` no |
68 // matter which bound they have syntactically (such that their value as types | 62 // matter which bound they have syntactically (such that their value as types |
69 // is unchecked), and then replacing method type variables by a `DynamicType` | 63 // is unchecked), and then replacing method type variables by a `DynamicType` |
70 // (such that the backend does not need to take method type arguments into | 64 // (such that the backend does not need to take method type arguments into |
71 // account). | 65 // account). |
72 // | |
73 // The feature has an informal specification which is available at | |
74 // https://gist.github.com/eernstg/4353d7b4f669745bed3a5423e04a453c. | |
75 static const String genericMethodSyntax = '--generic-method-syntax'; | 66 static const String genericMethodSyntax = '--generic-method-syntax'; |
76 | |
77 // Experimental flags. | |
78 static const String resolveOnly = '--resolve-only'; | 67 static const String resolveOnly = '--resolve-only'; |
79 static const String initializingFormalAccess = '--initializing-formal-access'; | 68 static const String initializingFormalAccess = '--initializing-formal-access'; |
80 } | 69 } |
81 | 70 |
82 class Option { | 71 class Option { |
83 static const String showPackageWarnings = | 72 static const String showPackageWarnings = |
84 '${Flags.showPackageWarnings}|${Flags.showPackageWarnings}=.*'; | 73 '${Flags.showPackageWarnings}|${Flags.showPackageWarnings}=.*'; |
85 | 74 |
86 // Experimental options. | 75 // Experimental options. |
87 static const String resolutionInput = '--resolution-input=.+'; | 76 static const String resolutionInput = '--resolution-input=.+'; |
88 static const String bazelPaths = '--bazel-paths=.+'; | 77 static const String bazelPaths = '--bazel-paths=.+'; |
89 } | 78 } |
OLD | NEW |