| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.src.options; | 5 library dart2js.src.options; |
| 6 | 6 |
| 7 import 'commandline_options.dart' show Flags; | 7 import 'commandline_options.dart' show Flags; |
| 8 import '../compiler.dart' show PackagesDiscoveryProvider; | 8 import '../compiler.dart' show PackagesDiscoveryProvider; |
| 9 | 9 |
| 10 /// Options used for parsing. | 10 /// Options used for parsing. |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 this.useContentSecurityPolicy: false, | 520 this.useContentSecurityPolicy: false, |
| 521 this.useCpsIr: false, | 521 this.useCpsIr: false, |
| 522 this.useFrequencyNamer: false, | 522 this.useFrequencyNamer: false, |
| 523 this.useNewSourceInfo: false, | 523 this.useNewSourceInfo: false, |
| 524 this.useStartupEmitter: false, | 524 this.useStartupEmitter: false, |
| 525 this.verbose: false}) | 525 this.verbose: false}) |
| 526 : _shownPackageWarnings = shownPackageWarnings; | 526 : _shownPackageWarnings = shownPackageWarnings; |
| 527 | 527 |
| 528 /// Creates a copy of the [CompilerOptions] where the provided non-null | 528 /// Creates a copy of the [CompilerOptions] where the provided non-null |
| 529 /// option values replace existing. | 529 /// option values replace existing. |
| 530 CompilerOptions copy( | 530 static CompilerOptions copy(CompilerOptions options, |
| 531 {entryPoint, | 531 {entryPoint, |
| 532 libraryRoot, | 532 libraryRoot, |
| 533 packageRoot, | 533 packageRoot, |
| 534 packageConfig, | 534 packageConfig, |
| 535 packagesDiscoveryProvider, | 535 packagesDiscoveryProvider, |
| 536 environment, | 536 environment, |
| 537 allowMockCompilation, | 537 allowMockCompilation, |
| 538 allowNativeExtensions, | 538 allowNativeExtensions, |
| 539 analyzeAll, | 539 analyzeAll, |
| 540 analyzeMain, | 540 analyzeMain, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 trustJSInteropTypeAnnotations, | 576 trustJSInteropTypeAnnotations, |
| 577 trustPrimitives, | 577 trustPrimitives, |
| 578 trustTypeAnnotations, | 578 trustTypeAnnotations, |
| 579 useContentSecurityPolicy, | 579 useContentSecurityPolicy, |
| 580 useCpsIr, | 580 useCpsIr, |
| 581 useFrequencyNamer, | 581 useFrequencyNamer, |
| 582 useNewSourceInfo, | 582 useNewSourceInfo, |
| 583 useStartupEmitter, | 583 useStartupEmitter, |
| 584 verbose}) { | 584 verbose}) { |
| 585 return new CompilerOptions._( | 585 return new CompilerOptions._( |
| 586 entryPoint ?? this.entryPoint, | 586 entryPoint ?? options.entryPoint, |
| 587 libraryRoot ?? this.libraryRoot, | 587 libraryRoot ?? options.libraryRoot, |
| 588 packageRoot ?? this.packageRoot, | 588 packageRoot ?? options.packageRoot, |
| 589 packageConfig ?? this.packageConfig, | 589 packageConfig ?? options.packageConfig, |
| 590 packagesDiscoveryProvider ?? this.packagesDiscoveryProvider, | 590 packagesDiscoveryProvider ?? options.packagesDiscoveryProvider, |
| 591 environment ?? this.environment, | 591 environment ?? options.environment, |
| 592 allowMockCompilation: allowMockCompilation ?? this.allowMockCompilation, | 592 allowMockCompilation: |
| 593 allowMockCompilation ?? options.allowMockCompilation, |
| 593 allowNativeExtensions: | 594 allowNativeExtensions: |
| 594 allowNativeExtensions ?? this.allowNativeExtensions, | 595 allowNativeExtensions ?? options.allowNativeExtensions, |
| 595 analyzeAll: analyzeAll ?? this.analyzeAll, | 596 analyzeAll: analyzeAll ?? options.analyzeAll, |
| 596 analyzeMain: analyzeMain ?? this.analyzeMain, | 597 analyzeMain: analyzeMain ?? options.analyzeMain, |
| 597 analyzeOnly: analyzeOnly ?? this.analyzeOnly, | 598 analyzeOnly: analyzeOnly ?? options.analyzeOnly, |
| 598 analyzeSignaturesOnly: | 599 analyzeSignaturesOnly: |
| 599 analyzeSignaturesOnly ?? this.analyzeSignaturesOnly, | 600 analyzeSignaturesOnly ?? options.analyzeSignaturesOnly, |
| 600 buildId: buildId ?? this.buildId, | 601 buildId: buildId ?? options.buildId, |
| 601 dart2dartMultiFile: dart2dartMultiFile ?? this.dart2dartMultiFile, | 602 dart2dartMultiFile: dart2dartMultiFile ?? options.dart2dartMultiFile, |
| 602 deferredMapUri: deferredMapUri ?? this.deferredMapUri, | 603 deferredMapUri: deferredMapUri ?? options.deferredMapUri, |
| 603 fatalWarnings: fatalWarnings ?? this.fatalWarnings, | 604 fatalWarnings: fatalWarnings ?? options.fatalWarnings, |
| 604 terseDiagnostics: terseDiagnostics ?? this.terseDiagnostics, | 605 terseDiagnostics: terseDiagnostics ?? options.terseDiagnostics, |
| 605 suppressWarnings: suppressWarnings ?? this.suppressWarnings, | 606 suppressWarnings: suppressWarnings ?? options.suppressWarnings, |
| 606 suppressHints: suppressHints ?? this.suppressHints, | 607 suppressHints: suppressHints ?? options.suppressHints, |
| 607 shownPackageWarnings: | 608 shownPackageWarnings: |
| 608 shownPackageWarnings ?? this._shownPackageWarnings, | 609 shownPackageWarnings ?? options._shownPackageWarnings, |
| 609 disableInlining: disableInlining ?? this.disableInlining, | 610 disableInlining: disableInlining ?? options.disableInlining, |
| 610 disableTypeInference: disableTypeInference ?? this.disableTypeInference, | 611 disableTypeInference: |
| 611 dumpInfo: dumpInfo ?? this.dumpInfo, | 612 disableTypeInference ?? options.disableTypeInference, |
| 612 emitJavaScript: emitJavaScript ?? this.emitJavaScript, | 613 dumpInfo: dumpInfo ?? options.dumpInfo, |
| 613 enableAssertMessage: enableAssertMessage ?? this.enableAssertMessage, | 614 emitJavaScript: emitJavaScript ?? options.emitJavaScript, |
| 615 enableAssertMessage: enableAssertMessage ?? options.enableAssertMessage, |
| 614 enableGenericMethodSyntax: | 616 enableGenericMethodSyntax: |
| 615 enableGenericMethodSyntax ?? this.enableGenericMethodSyntax, | 617 enableGenericMethodSyntax ?? options.enableGenericMethodSyntax, |
| 616 enableInitializingFormalAccess: enableInitializingFormalAccess ?? | 618 enableInitializingFormalAccess: enableInitializingFormalAccess ?? |
| 617 this.enableInitializingFormalAccess, | 619 options.enableInitializingFormalAccess, |
| 618 enableExperimentalMirrors: | 620 enableExperimentalMirrors: |
| 619 enableExperimentalMirrors ?? this.enableExperimentalMirrors, | 621 enableExperimentalMirrors ?? options.enableExperimentalMirrors, |
| 620 enableMinification: enableMinification ?? this.enableMinification, | 622 enableMinification: enableMinification ?? options.enableMinification, |
| 621 enableNativeLiveTypeAnalysis: | 623 enableNativeLiveTypeAnalysis: enableNativeLiveTypeAnalysis ?? |
| 622 enableNativeLiveTypeAnalysis ?? this.enableNativeLiveTypeAnalysis, | 624 options.enableNativeLiveTypeAnalysis, |
| 623 enableTypeAssertions: enableTypeAssertions ?? this.enableTypeAssertions, | 625 enableTypeAssertions: |
| 624 enableUserAssertions: enableUserAssertions ?? this.enableUserAssertions, | 626 enableTypeAssertions ?? options.enableTypeAssertions, |
| 627 enableUserAssertions: |
| 628 enableUserAssertions ?? options.enableUserAssertions, |
| 625 generateCodeWithCompileTimeErrors: generateCodeWithCompileTimeErrors ?? | 629 generateCodeWithCompileTimeErrors: generateCodeWithCompileTimeErrors ?? |
| 626 this.generateCodeWithCompileTimeErrors, | 630 options.generateCodeWithCompileTimeErrors, |
| 627 generateSourceMap: generateSourceMap ?? this.generateSourceMap, | 631 generateSourceMap: generateSourceMap ?? options.generateSourceMap, |
| 628 hasIncrementalSupport: | 632 hasIncrementalSupport: |
| 629 hasIncrementalSupport ?? this.hasIncrementalSupport, | 633 hasIncrementalSupport ?? options.hasIncrementalSupport, |
| 630 outputUri: outputUri ?? this.outputUri, | 634 outputUri: outputUri ?? options.outputUri, |
| 631 platformConfigUri: platformConfigUri ?? this.platformConfigUri, | 635 platformConfigUri: platformConfigUri ?? options.platformConfigUri, |
| 632 preserveComments: preserveComments ?? this.preserveComments, | 636 preserveComments: preserveComments ?? options.preserveComments, |
| 633 preserveUris: preserveUris ?? this.preserveUris, | 637 preserveUris: preserveUris ?? options.preserveUris, |
| 634 resolutionInputs: resolutionInputs ?? this.resolutionInputs, | 638 resolutionInputs: resolutionInputs ?? options.resolutionInputs, |
| 635 resolutionOutput: resolutionOutput ?? this.resolutionOutput, | 639 resolutionOutput: resolutionOutput ?? options.resolutionOutput, |
| 636 resolveOnly: resolveOnly ?? this.resolveOnly, | 640 resolveOnly: resolveOnly ?? options.resolveOnly, |
| 637 sourceMapUri: sourceMapUri ?? this.sourceMapUri, | 641 sourceMapUri: sourceMapUri ?? options.sourceMapUri, |
| 638 strips: strips ?? this.strips, | 642 strips: strips ?? options.strips, |
| 639 testMode: testMode ?? this.testMode, | 643 testMode: testMode ?? options.testMode, |
| 640 trustJSInteropTypeAnnotations: | 644 trustJSInteropTypeAnnotations: trustJSInteropTypeAnnotations ?? |
| 641 trustJSInteropTypeAnnotations ?? this.trustJSInteropTypeAnnotations, | 645 options.trustJSInteropTypeAnnotations, |
| 642 trustPrimitives: trustPrimitives ?? this.trustPrimitives, | 646 trustPrimitives: trustPrimitives ?? options.trustPrimitives, |
| 643 trustTypeAnnotations: trustTypeAnnotations ?? this.trustTypeAnnotations, | 647 trustTypeAnnotations: |
| 648 trustTypeAnnotations ?? options.trustTypeAnnotations, |
| 644 useContentSecurityPolicy: | 649 useContentSecurityPolicy: |
| 645 useContentSecurityPolicy ?? this.useContentSecurityPolicy, | 650 useContentSecurityPolicy ?? options.useContentSecurityPolicy, |
| 646 useCpsIr: useCpsIr ?? this.useCpsIr, | 651 useCpsIr: useCpsIr ?? options.useCpsIr, |
| 647 useFrequencyNamer: useFrequencyNamer ?? this.useFrequencyNamer, | 652 useFrequencyNamer: useFrequencyNamer ?? options.useFrequencyNamer, |
| 648 useNewSourceInfo: useNewSourceInfo ?? this.useNewSourceInfo, | 653 useNewSourceInfo: useNewSourceInfo ?? options.useNewSourceInfo, |
| 649 useStartupEmitter: useStartupEmitter ?? this.useStartupEmitter, | 654 useStartupEmitter: useStartupEmitter ?? options.useStartupEmitter, |
| 650 verbose: verbose ?? this.verbose); | 655 verbose: verbose ?? options.verbose); |
| 651 } | 656 } |
| 652 | 657 |
| 653 /// Returns `true` if warnings and hints are shown for all packages. | 658 /// Returns `true` if warnings and hints are shown for all packages. |
| 654 bool get showAllPackageWarnings { | 659 bool get showAllPackageWarnings { |
| 655 return _shownPackageWarnings != null && _shownPackageWarnings.isEmpty; | 660 return _shownPackageWarnings != null && _shownPackageWarnings.isEmpty; |
| 656 } | 661 } |
| 657 | 662 |
| 658 /// Returns `true` if warnings and hints are hidden for all packages. | 663 /// Returns `true` if warnings and hints are hidden for all packages. |
| 659 bool get hidePackageWarnings => _shownPackageWarnings == null; | 664 bool get hidePackageWarnings => _shownPackageWarnings == null; |
| 660 | 665 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 | 753 |
| 749 /// Locations of the platform descriptor files relative to the library root. | 754 /// Locations of the platform descriptor files relative to the library root. |
| 750 const String _clientPlatform = "lib/dart_client.platform"; | 755 const String _clientPlatform = "lib/dart_client.platform"; |
| 751 const String _serverPlatform = "lib/dart_server.platform"; | 756 const String _serverPlatform = "lib/dart_server.platform"; |
| 752 const String _sharedPlatform = "lib/dart_shared.platform"; | 757 const String _sharedPlatform = "lib/dart_shared.platform"; |
| 753 const String _dart2dartPlatform = "lib/dart2dart.platform"; | 758 const String _dart2dartPlatform = "lib/dart2dart.platform"; |
| 754 | 759 |
| 755 const String _UNDETERMINED_BUILD_ID = "build number could not be determined"; | 760 const String _UNDETERMINED_BUILD_ID = "build number could not be determined"; |
| 756 const bool _forceIncrementalSupport = | 761 const bool _forceIncrementalSupport = |
| 757 const bool.fromEnvironment('DART2JS_EXPERIMENTAL_INCREMENTAL_SUPPORT'); | 762 const bool.fromEnvironment('DART2JS_EXPERIMENTAL_INCREMENTAL_SUPPORT'); |
| OLD | NEW |