Skip to content

Commit 80544b1

Browse files
floitschGwhesse
authored andcommitted
1 parent e2d59e7 commit 80544b1

File tree

11 files changed

+20
-30
lines changed

11 files changed

+20
-30
lines changed

pkg/analysis_server/test/context_manager_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@ analyzer:
400400
language:
401401
enableGenericMethods: true
402402
enableAsync: false
403-
enableConditionalDirectives: true
404403
errors:
405404
unused_local_variable: false
406405
linter:
@@ -426,7 +425,6 @@ linter:
426425
expect(context.analysisOptions.enableAsync, isFalse);
427426
// * from `.analysis_options`:
428427
expect(context.analysisOptions.enableGenericMethods, isTrue);
429-
expect(context.analysisOptions.enableConditionalDirectives, isTrue);
430428

431429
// * verify tests are excluded
432430
expect(

pkg/analyzer/lib/src/generated/engine.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ abstract class AnalysisOptions {
10621062
/**
10631063
* Return `true` to enable interface libraries (DEP 40).
10641064
*/
1065+
@deprecated
10651066
bool get enableConditionalDirectives;
10661067

10671068
/**
@@ -1201,7 +1202,10 @@ class AnalysisOptionsImpl implements AnalysisOptions {
12011202
/**
12021203
* A flag indicating whether interface libraries are to be supported (DEP 40).
12031204
*/
1204-
bool enableConditionalDirectives = false;
1205+
bool get enableConditionalDirectives => true;
1206+
1207+
@deprecated
1208+
void set enableConditionalDirectives(_) {}
12051209

12061210
/**
12071211
* A flag indicating whether generic methods are to be supported (DEP 22).
@@ -1297,7 +1301,6 @@ class AnalysisOptionsImpl implements AnalysisOptions {
12971301
dart2jsHint = options.dart2jsHint;
12981302
enableAssertMessage = options.enableAssertMessage;
12991303
enableAsync = options.enableAsync;
1300-
enableConditionalDirectives = options.enableConditionalDirectives;
13011304
enableStrictCallChecks = options.enableStrictCallChecks;
13021305
enableGenericMethods = options.enableGenericMethods;
13031306
enableSuperMixins = options.enableSuperMixins;

pkg/analyzer/test/src/task/options_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ analyzer:
6868
}
6969

7070
test_configure_enableConditionalDirectives() {
71-
expect(analysisOptions.enableConditionalDirectives, false);
71+
expect(analysisOptions.enableConditionalDirectives, true);
7272
configureContext('''
7373
analyzer:
7474
language:

pkg/compiler/lib/src/commandline_options.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ class Flags {
4949
static const String verbose = '--verbose';
5050
static const String version = '--version';
5151

52-
// Experimental flags.
5352
static const String conditionalDirectives = '--conditional-directives';
53+
54+
// Experimental flags.
5455
static const String genericMethodSyntax = '--generic-method-syntax';
5556
}
5657

pkg/compiler/lib/src/dart2js.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ Future<api.CompilationResult> compile(List<String> argv) {
326326
new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true),
327327
new OptionHandler(Flags.allowMockCompilation, passThrough),
328328
new OptionHandler(Flags.fastStartup, passThrough),
329-
new OptionHandler(Flags.conditionalDirectives, passThrough),
330329
new OptionHandler(Flags.genericMethodSyntax, passThrough),
331330
new OptionHandler('${Flags.minify}|-m', implyCompilation),
332331
new OptionHandler(Flags.preserveUris, passThrough),
@@ -364,6 +363,10 @@ Future<api.CompilationResult> compile(List<String> argv) {
364363
new OptionHandler(Flags.useContentSecurityPolicy, passThrough),
365364
new OptionHandler(Flags.enableExperimentalMirrors, passThrough),
366365
new OptionHandler(Flags.enableAssertMessage, passThrough),
366+
// TODO(floitsch): remove conditional directives flag.
367+
// We don't provide the info-message yet, since we haven't publicly
368+
// launched the feature yet.
369+
new OptionHandler(Flags.conditionalDirectives, (_) {}),
367370
new OptionHandler('--enable-async', (_) {
368371
diagnosticHandler.info(
369372
"Option '--enable-async' is no longer needed. "

pkg/compiler/lib/src/options.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ import '../compiler.dart' show PackagesDiscoveryProvider;
1414
abstract class ParserOptions {
1515
const ParserOptions();
1616

17-
/// Support conditional directives, e.g., configurable imports.
18-
bool get enableConditionalDirectives;
19-
2017
/// Support parsing of generic method declarations, and invocations of
2118
/// methods where type arguments are passed.
2219
bool get enableGenericMethodSyntax;
@@ -148,9 +145,6 @@ class CompilerOptions implements DiagnosticOptions, ParserOptions {
148145
/// reason for why an assertion fails. (experimental)
149146
final bool enableAssertMessage;
150147

151-
/// Whether to enable the experimental conditional directives feature.
152-
final bool enableConditionalDirectives;
153-
154148
/// Support parsing of generic method declarations, and invocations of
155149
/// methods where type arguments are passed.
156150
final bool enableGenericMethodSyntax;
@@ -285,8 +279,6 @@ class CompilerOptions implements DiagnosticOptions, ParserOptions {
285279
emitJavaScript: !(_hasOption(options, '--output-type=dart') ||
286280
_hasOption(options, '--output-type=dart-multi')),
287281
enableAssertMessage: _hasOption(options, Flags.enableAssertMessage),
288-
enableConditionalDirectives:
289-
_hasOption(options, Flags.conditionalDirectives),
290282
enableGenericMethodSyntax:
291283
_hasOption(options, Flags.genericMethodSyntax),
292284
enableExperimentalMirrors:
@@ -354,7 +346,6 @@ class CompilerOptions implements DiagnosticOptions, ParserOptions {
354346
bool dumpInfo: false,
355347
bool emitJavaScript: true,
356348
bool enableAssertMessage: false,
357-
bool enableConditionalDirectives: false,
358349
bool enableGenericMethodSyntax: false,
359350
bool enableExperimentalMirrors: false,
360351
bool enableMinification: false,
@@ -424,7 +415,6 @@ class CompilerOptions implements DiagnosticOptions, ParserOptions {
424415
dumpInfo: dumpInfo,
425416
emitJavaScript: emitJavaScript,
426417
enableAssertMessage: enableAssertMessage,
427-
enableConditionalDirectives: enableConditionalDirectives,
428418
enableGenericMethodSyntax: enableGenericMethodSyntax,
429419
enableExperimentalMirrors: enableExperimentalMirrors,
430420
enableMinification: enableMinification,
@@ -475,7 +465,6 @@ class CompilerOptions implements DiagnosticOptions, ParserOptions {
475465
this.dumpInfo: false,
476466
this.emitJavaScript: true,
477467
this.enableAssertMessage: false,
478-
this.enableConditionalDirectives: false,
479468
this.enableGenericMethodSyntax: false,
480469
this.enableExperimentalMirrors: false,
481470
this.enableMinification: false,

pkg/compiler/lib/src/parser/parser.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,9 @@ class Parser {
184184
Token parseConditionalUris(Token token) {
185185
listener.beginConditionalUris(token);
186186
int count = 0;
187-
if (parserOptions.enableConditionalDirectives) {
188-
while (optional('if', token)) {
189-
count++;
190-
token = parseConditionalUri(token);
191-
}
187+
while (optional('if', token)) {
188+
count++;
189+
token = parseConditionalUri(token);
192190
}
193191
listener.endConditionalUris(count);
194192
return token;

runtime/vm/parser.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ namespace dart {
4444
DEFINE_FLAG(bool, enable_debug_break, false, "Allow use of break \"message\".");
4545
DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations.");
4646
DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef.");
47-
DEFINE_FLAG(bool, conditional_directives, false,
47+
// TODO(floitsch): remove the conditional-directive flag, once we publicly
48+
// committed to the current version.
49+
DEFINE_FLAG(bool, conditional_directives, true,
4850
"Enable conditional directives");
4951
DEFINE_FLAG(bool, warn_super, false,
5052
"Warning if super initializer not last in initializer list.");

tests/compiler/dart2js/options_helper.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ class MockDiagnosticOptions implements DiagnosticOptions {
2020
}
2121

2222
class MockParserOptions implements ParserOptions {
23-
bool get enableConditionalDirectives => true;
2423
bool get enableGenericMethodSyntax => true;
2524
}

tests/language/config_import_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44
//
5-
// DartOptions=-Did=true -Ddotted.id=some_string -Dlots.of.dots.In.id=false --conditional-directives
6-
// VMOptions=-Did=true -Ddotted.id=some_string -Dlots.of.dots.In.id=false --conditional-directives
5+
// DartOptions=-Did=true -Ddotted.id=some_string -Dlots.of.dots.In.id=false
6+
// VMOptions=-Did=true -Ddotted.id=some_string -Dlots.of.dots.In.id=false
77

88
import 'package:expect/expect.dart';
99

tests/language/language_analyzer2.status

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ multiline_newline_test/06: MissingCompileTimeError # Issue 23888
4242

4343
const_for_in_variable_test/01: MissingCompileTimeError # Issue 25161
4444

45-
# Unsupported configuration specific imports.
46-
config_import_test: CompileTimeError # Issue 24579
47-
4845
# Please add new failing tests before this line.
4946
# Section below is for invalid tests.
5047
#

0 commit comments

Comments
 (0)