未验证 提交 f3f005c4 编写于 作者: I Ian Hickson 提交者: GitHub

Analysis cleanup of the Dart in the Engine repo (#4554)

* Analysis cleanup of the Dart in the Engine repo

* Update painting.dart

* Update painting.dart
上级 6de9931c
language: dart
dart:
- "dev/release/1.25.0-dev.11.0"
- dev
sudo: false
before_script:
- ./travis/setup.sh
......
# Specify analysis options.
#
# This file is a copy of analysis_options_repo.yaml from flutter repo:
# https://github.com/flutter/flutter/blob/master/analysis_options_repo.yaml
# This file is a copy of analysis_options_repo.yaml from flutter repo
# as of 2018-01-07, but with "sort_constructors_first" disabled
# (because we have private fake constructors), with
# "always_require_non_null_named_parameters" disabled (because we
# can't import the meta package from the SDK), and with
# "prefer_final_fields" disabled (because we do weird things with
# private fields, especially on the Window object):
# https://github.com/lfutter/flutter/blob/master/analysis_options_repo.yaml
analyzer:
language:
enableStrictCallChecks: true
enableSuperMixins: true
enableAssertInitializer: true
strong-mode:
implicit-dynamic: false
errors:
......@@ -22,88 +27,90 @@ linter:
rules:
# these rules are documented on and in the same order as
# the Dart Lint rules page to make maintenance easier
# http://dart-lang.github.io/linter/lints/
# === error rules ===
- avoid_empty_else
- avoid_slow_async_io
- cancel_subscriptions
# - close_sinks # https://github.com/flutter/flutter/issues/5789
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
- control_flow_in_finally
- empty_statements
- hash_and_equals
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
- iterable_contains_unrelated_type
- list_remove_unrelated_type
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
- no_adjacent_strings_in_list
- no_duplicate_case_values
- test_types_in_equals
- throw_in_finally
- unrelated_type_equality_checks
- valid_regexps
# === style rules ===
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
- always_declare_return_types
- always_put_control_body_on_new_line
- always_require_non_null_named_parameters
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
# always_require_non_null_named_parameters
- always_specify_types
- annotate_overrides
# - avoid_annotating_with_dynamic # not yet tested
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
- avoid_as
# - avoid_catches_without_on_clauses # not yet tested
# - avoid_catching_errors # not yet tested
# - avoid_classes_with_only_static_members # not yet tested
# - avoid_function_literals_in_foreach_calls # not yet tested
# - avoid_catches_without_on_clauses # we do this commonly
# - avoid_catching_errors # we do this commonly
- avoid_classes_with_only_static_members
- avoid_empty_else
- avoid_function_literals_in_foreach_calls
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # not yet tested
- avoid_return_types_on_setters
# - avoid_returning_null # not yet tested
# - avoid_returning_this # not yet tested
# - avoid_returning_null # we do this commonly
# - avoid_returning_this # https://github.com/dart-lang/linter/issues/842
# - avoid_setters_without_getters # not yet tested
# - avoid_types_on_closure_parameters # not yet tested
- avoid_slow_async_io
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
# - avoid_unused_constructor_parameters # https://github.com/dart-lang/linter/pull/847
- await_only_futures
- camel_case_types
- cancel_subscriptions
# - cascade_invocations # not yet tested
# - close_sinks # https://github.com/flutter/flutter/issues/5789
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
- control_flow_in_finally
- directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
- hash_and_equals
- implementation_imports
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
- iterable_contains_unrelated_type
# - join_return_with_assignment # not yet tested
- library_names
- library_prefixes
- list_remove_unrelated_type
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
- no_adjacent_strings_in_list
- no_duplicate_case_values
- non_constant_identifier_names
# - omit_local_variable_types # opposite of always_specify_types
# - one_member_abstracts # too many false positives
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
# - parameter_assignments # we do this commonly
- prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists
# - prefer_bool_in_asserts # not yet tested
- prefer_collection_literals
# - prefer_conditional_assignment # not yet tested
# - prefer_const_constructors # https://github.com/dart-lang/linter/issues/752
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_constructors_in_immutables
# - prefer_constructors_over_static_methods # not yet tested
- prefer_contains
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
# - prefer_final_fields # https://github.com/dart-lang/linter/issues/506
# - prefer_final_fields
- prefer_final_locals
# - prefer_foreach # not yet tested
- prefer_foreach
# - prefer_function_declarations_over_variables # not yet tested
- prefer_initializing_formals
# - prefer_interpolation_to_compose_strings # not yet tested
- prefer_is_empty
- prefer_is_not_empty
- public_member_api_docs # this is the only difference from analysis_options_repo.yaml
# - recursive_getters # https://github.com/dart-lang/linter/issues/452
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- public_member_api_docs # this is the only difference from analysis_options.yaml
- recursive_getters
- slash_for_doc_comments
- sort_constructors_first
# - sort_constructors_first
- sort_unnamed_constructors_first
- super_goes_last
- test_types_in_equals
- throw_in_finally
# - type_annotate_public_apis # subset of always_specify_types
- type_init_formals
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
......@@ -112,12 +119,12 @@ linter:
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
# - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627
- unnecessary_overrides
# - unnecessary_statements # not yet tested
- unnecessary_this
- unrelated_type_equality_checks
- use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
# === pub rules ===
- package_names
- valid_regexps
*.dill
pubspec.lock
.packages
# Generated by pub on 2017-08-22 07:05:11.485224.
analyzer:../../third_party/dart/pkg/analyzer/lib/
args:../../third_party/dart/third_party/pkg/args/lib/
async:../../third_party/dart/third_party/pkg/async/lib/
barback:../../third_party/dart/third_party/pkg/barback/lib/
boolean_selector:../../third_party/dart/third_party/pkg/boolean_selector/lib/
charcode:../../third_party/dart/third_party/pkg/charcode/lib/
cli_util:../../third_party/dart/third_party/pkg/cli_util/lib/
collection:../../third_party/dart/third_party/pkg/collection/lib/
convert:../../third_party/dart/third_party/pkg/convert/lib/
crypto:../../third_party/dart/third_party/pkg/crypto/lib/
csslib:../../third_party/dart/third_party/pkg/csslib/lib/
front_end:../../third_party/dart/pkg/front_end/lib/
glob:../../third_party/dart/third_party/pkg/glob/lib/
html:../../third_party/dart/third_party/pkg/html/lib/
http:../../third_party/dart/third_party/pkg/http/lib/
http_multi_server:../../third_party/dart/third_party/pkg/http_multi_server/lib/
http_parser:../../third_party/dart/third_party/pkg/http_parser/lib/
isolate:../../third_party/dart/third_party/pkg/isolate/lib/
kernel:../../third_party/dart/pkg/kernel/lib/
logging:../../third_party/dart/third_party/pkg/logging/lib/
matcher:../../third_party/dart/third_party/pkg/matcher/lib/
meta:../../third_party/dart/pkg/meta/lib/
mime:../../third_party/dart/third_party/pkg/mime/lib/
mockito:../../third_party/dart/third_party/pkg/mockito/lib/
package_config:../../third_party/dart/third_party/pkg_tested/package_config/lib/
package_resolver:../../third_party/dart/third_party/pkg_tested/package_resolver/lib/
path:../../third_party/dart/third_party/pkg/path/lib/
plugin:../../third_party/dart/third_party/pkg/plugin/lib/
pool:../../third_party/dart/third_party/pkg/pool/lib/
pub_semver:../../third_party/dart/third_party/pkg/pub_semver/lib/
quiver:../../third_party/dart/third_party/pkg/quiver/lib/
shelf:../../third_party/dart/third_party/pkg/shelf/lib/
shelf_packages_handler:../../third_party/dart/third_party/pkg/shelf_packages_handler/lib/
shelf_static:../../third_party/dart/third_party/pkg/shelf_static/lib/
shelf_web_socket:../../third_party/dart/third_party/pkg/shelf_web_socket/lib/
source_map_stack_trace:../../third_party/dart/third_party/pkg/source_map_stack_trace/lib/
source_maps:../../third_party/dart/third_party/pkg/source_maps/lib/
source_span:../../third_party/dart/third_party/pkg/source_span/lib/
stack_trace:../../third_party/dart/third_party/pkg/stack_trace/lib/
stream_channel:../../third_party/dart/third_party/pkg/stream_channel/lib/
string_scanner:../../third_party/dart/third_party/pkg/string_scanner/lib/
test:../../third_party/dart/third_party/pkg/test/lib/
typed_data:../../third_party/dart/third_party/pkg/typed_data/lib/
usage:../../third_party/dart/third_party/pkg/usage/lib/
utf:../../third_party/dart/third_party/pkg/utf/lib/
vm:../../third_party/dart/pkg/vm/lib/
watcher:../../third_party/dart/third_party/pkg/watcher/lib/
web_socket_channel:../../third_party/dart/third_party/pkg/web_socket_channel/lib/
when:../../third_party/pkg/when/lib/
yaml:../../third_party/dart/third_party/pkg/yaml/lib/
frontend_server:lib/
......@@ -140,9 +140,9 @@ class _FrontendCompiler implements CompilerInterface {
IncrementalKernelGenerator generator,
}) async {
final Uri filenameUri = Uri.base.resolveUri(new Uri.file(filename));
_kernelBinaryFilename = "$filename.dill";
_kernelBinaryFilename = '$filename.dill';
final String boundaryKey = new Uuid().generateV4();
_outputStream.writeln("result $boundaryKey");
_outputStream.writeln('result $boundaryKey');
final Uri sdkRoot = _ensureFolderPath(options['sdk-root']);
final String byteStorePath = options['byte-store'];
final CompilerOptions compilerOptions = new CompilerOptions()
......@@ -182,7 +182,7 @@ class _FrontendCompiler implements CompilerInterface {
final BinaryPrinter printer = printerFactory.newBinaryPrinter(sink);
printer.writeProgramFile(program);
await sink.close();
_outputStream.writeln("$boundaryKey $_kernelBinaryFilename");
_outputStream.writeln('$boundaryKey $_kernelBinaryFilename');
} else
_outputStream.writeln(boundaryKey);
return null;
......@@ -191,13 +191,13 @@ class _FrontendCompiler implements CompilerInterface {
@override
Future<Null> recompileDelta() async {
final String boundaryKey = new Uuid().generateV4();
_outputStream.writeln("result $boundaryKey");
_outputStream.writeln('result $boundaryKey');
final DeltaProgram deltaProgram = await _generator.computeDelta();
final IOSink sink = new File(_kernelBinaryFilename).openWrite();
final BinaryPrinter printer = printerFactory.newBinaryPrinter(sink);
printer.writeProgramFile(deltaProgram.newProgram);
await sink.close();
_outputStream.writeln("$boundaryKey $_kernelBinaryFilename");
_outputStream.writeln('$boundaryKey $_kernelBinaryFilename');
return null;
}
......@@ -282,7 +282,7 @@ Future<int> starter(
// Has to be a directory, that won't have any of the compiled application
// sources, so that no relative paths could show up in the kernel file.
Directory.current = Directory.systemTemp;
final Directory workingDirectory = new Directory("flutter_frontend_server");
final Directory workingDirectory = new Directory('flutter_frontend_server');
workingDirectory.createSync();
Directory.current = workingDirectory;
......@@ -295,7 +295,7 @@ Future<int> starter(
String boundaryKey;
input
.transform(UTF8.decoder)
.transform(new LineSplitter())
.transform(const LineSplitter())
.listen((String string) async {
switch (state) {
case _State.READY_FOR_INSTRUCTION:
......
......@@ -369,7 +369,7 @@ Future<int> main() async {
String boundaryKey;
stdoutStreamController.stream
.transform(UTF8.decoder)
.transform(new LineSplitter())
.transform(const LineSplitter())
.listen((String s) {
const String RESULT_OUTPUT_SPACE = 'result ';
if (boundaryKey == null) {
......@@ -387,7 +387,7 @@ Future<int> main() async {
final _MockedIncrementalKernelGenerator generator =
new _MockedIncrementalKernelGenerator();
when(generator.computeDelta()).thenReturn(new Future<DeltaProgram>.value(
new DeltaProgram("", null /* program stub */)
new DeltaProgram('', null /* program stub */)
));
final _MockedBinaryPrinterFactory printerFactory =
new _MockedBinaryPrinterFactory();
......
......@@ -20,7 +20,7 @@ class Scene extends NativeFieldWrapperClass2 {
/// Releases the resources used by this scene.
///
/// After calling this function, the scene is cannot be used further.
void dispose() native "Scene_dispose";
void dispose() native 'Scene_dispose';
}
/// Builds a [Scene] containing the given visuals.
......@@ -33,7 +33,7 @@ class Scene extends NativeFieldWrapperClass2 {
class SceneBuilder extends NativeFieldWrapperClass2 {
/// Creates an empty [SceneBuilder] object.
SceneBuilder() { _constructor(); }
void _constructor() native "SceneBuilder_constructor";
void _constructor() native 'SceneBuilder_constructor';
/// Pushes a transform operation onto the operation stack.
///
......@@ -42,12 +42,12 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
/// See [pop] for details about the operation stack.
void pushTransform(Float64List matrix4) {
if (matrix4 == null)
throw new ArgumentError("[matrix4] argument cannot be null");
throw new ArgumentError('"matrix4" argument cannot be null');
if (matrix4.length != 16)
throw new ArgumentError("[matrix4] must have 16 entries.");
throw new ArgumentError('"matrix4" must have 16 entries.');
_pushTransform(matrix4);
}
void _pushTransform(Float64List matrix4) native "SceneBuilder_pushTransform";
void _pushTransform(Float64List matrix4) native 'SceneBuilder_pushTransform';
/// Pushes a rectangular clip operation onto the operation stack.
///
......@@ -60,7 +60,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
void _pushClipRect(double left,
double right,
double top,
double bottom) native "SceneBuilder_pushClipRect";
double bottom) native 'SceneBuilder_pushClipRect';
/// Pushes a rounded-rectangular clip operation onto the operation stack.
///
......@@ -68,14 +68,14 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
///
/// See [pop] for details about the operation stack.
void pushClipRRect(RRect rrect) => _pushClipRRect(rrect._value);
void _pushClipRRect(Float32List rrect) native "SceneBuilder_pushClipRRect";
void _pushClipRRect(Float32List rrect) native 'SceneBuilder_pushClipRRect';
/// Pushes a path clip operation onto the operation stack.
///
/// Rasterization outside the given path is discarded.
///
/// See [pop] for details about the operation stack.
void pushClipPath(Path path) native "SceneBuilder_pushClipPath";
void pushClipPath(Path path) native 'SceneBuilder_pushClipPath';
/// Pushes an opacity operation onto the operation stack.
///
......@@ -85,7 +85,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
/// opacity).
///
/// See [pop] for details about the operation stack.
void pushOpacity(int alpha) native "SceneBuilder_pushOpacity";
void pushOpacity(int alpha) native 'SceneBuilder_pushOpacity';
/// Pushes a color filter operation onto the operation stack.
///
......@@ -96,7 +96,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
void pushColorFilter(Color color, BlendMode blendMode) {
_pushColorFilter(color.value, blendMode.index);
}
void _pushColorFilter(int color, int blendMode) native "SceneBuilder_pushColorFilter";
void _pushColorFilter(int color, int blendMode) native 'SceneBuilder_pushColorFilter';
/// Pushes a backdrop filter operation onto the operation stack.
///
......@@ -104,7 +104,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
/// rasterizing the given objects.
///
/// See [pop] for details about the operation stack.
void pushBackdropFilter(ImageFilter filter) native "SceneBuilder_pushBackdropFilter";
void pushBackdropFilter(ImageFilter filter) native 'SceneBuilder_pushBackdropFilter';
/// Pushes a shader mask operation onto the operation stack.
///
......@@ -125,7 +125,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
double maskRectRight,
double maskRectTop,
double maskRectBottom,
int blendMode) native "SceneBuilder_pushShaderMask";
int blendMode) native 'SceneBuilder_pushShaderMask';
/// Pushes a physical layer operation for an arbitrary shape onto the
/// operation stack.
......@@ -137,7 +137,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
_pushPhysicalShape(path, elevation, color.value);
}
void _pushPhysicalShape(Path path, double elevation, int color) native
"SceneBuilder_pushPhysicalShape";
'SceneBuilder_pushPhysicalShape';
/// Ends the effect of the most recently pushed operation.
///
......@@ -145,7 +145,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
/// operations in the stack applies to each of the objects added to the scene.
/// Calling this function removes the most recently added operation from the
/// stack.
void pop() native "SceneBuilder_pop";
void pop() native 'SceneBuilder_pop';
/// Adds an object to the scene that displays performance statistics.
///
......@@ -182,7 +182,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
double left,
double right,
double top,
double bottom) native "SceneBuilder_addPerformanceOverlay";
double bottom) native 'SceneBuilder_addPerformanceOverlay';
/// Adds a [Picture] to the scene.
///
......@@ -195,7 +195,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
hints |= 2;
_addPicture(offset.dx, offset.dy, picture, hints);
}
void _addPicture(double dx, double dy, Picture picture, int hints) native "SceneBuilder_addPicture";
void _addPicture(double dx, double dy, Picture picture, int hints) native 'SceneBuilder_addPicture';
/// Adds a backend texture to the scene.
///
......@@ -204,7 +204,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
assert(offset != null, 'Offset argument was null');
_addTexture(offset.dx, offset.dy, width, height, textureId);
}
void _addTexture(double dx, double dy, double width, double height, int textureId) native "SceneBuilder_addTexture";
void _addTexture(double dx, double dy, double width, double height, int textureId) native 'SceneBuilder_addTexture';
/// (Fuchsia-only) Adds a scene rendered by another application to the scene
/// for this application.
......@@ -227,7 +227,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
double width,
double height,
SceneHost sceneHost,
bool hitTestable) native "SceneBuilder_addChildScene";
bool hitTestable) native 'SceneBuilder_addChildScene';
/// Sets a threshold after which additional debugging information should be recorded.
///
......@@ -235,7 +235,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
/// interested in using this feature, please contact [flutter-dev](https://groups.google.com/forum/#!forum/flutter-dev).
/// We'll hopefully be able to figure out how to make this feature more useful
/// to you.
void setRasterizerTracingThreshold(int frameInterval) native "SceneBuilder_setRasterizerTracingThreshold";
void setRasterizerTracingThreshold(int frameInterval) native 'SceneBuilder_setRasterizerTracingThreshold';
/// Sets whether the raster cache should checkerboard cached entries. This is
/// only useful for debugging purposes.
......@@ -252,13 +252,13 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
///
/// Currently this interface is difficult to use by end-developers. If you're
/// interested in using this feature, please contact [flutter-dev](https://groups.google.com/forum/#!forum/flutter-dev).
void setCheckerboardRasterCacheImages(bool checkerboard) native "SceneBuilder_setCheckerboardRasterCacheImages";
void setCheckerboardRasterCacheImages(bool checkerboard) native 'SceneBuilder_setCheckerboardRasterCacheImages';
/// Sets whether the compositor should checkerboard layers that are rendered
/// to offscreen bitmaps.
///
/// This is only useful for debugging purposes.
void setCheckerboardOffscreenLayers(bool checkerboard) native "SceneBuilder_setCheckerboardOffscreenLayers";
void setCheckerboardOffscreenLayers(bool checkerboard) native 'SceneBuilder_setCheckerboardOffscreenLayers';
/// Finishes building the scene.
///
......@@ -268,7 +268,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
///
/// After calling this function, the scene builder object is invalid and
/// cannot be used further.
Scene build() native "SceneBuilder_build";
Scene build() native 'SceneBuilder_build';
}
/// (Fuchsia-only) Hosts content provided by another application.
......@@ -285,13 +285,13 @@ class SceneHost extends NativeFieldWrapperClass2 {
/// //topaz/public/lib/ui/flutter/.
///
/// The scene host takes ownership of the provided export token handle.
SceneHost(dynamic export_token_handle) {
_constructor(export_token_handle);
SceneHost(dynamic exportTokenHandle) {
_constructor(exportTokenHandle);
}
void _constructor(dynamic export_token_handle) native "SceneHost_constructor";
void _constructor(dynamic exportTokenHandle) native 'SceneHost_constructor';
/// Releases the resources associated with the child scene host.
///
/// After calling this function, the child scene host cannot be used further.
void dispose() native "SceneHost_dispose";
void dispose() native 'SceneHost_dispose';
}
......@@ -325,6 +325,9 @@ class Offset extends OffsetBase {
_dy == typedOther._dy;
}
@override
int get hashCode => hashValues(_dx, _dy);
@override
String toString() => 'Offset(${dx?.toStringAsFixed(1)}, ${dy?.toStringAsFixed(1)})';
}
......@@ -566,6 +569,9 @@ class Size extends OffsetBase {
_dy == typedOther._dy;
}
@override
int get hashCode => hashValues(_dx, _dy);
@override
String toString() => 'Size(${width?.toStringAsFixed(1)}, ${height?.toStringAsFixed(1)})';
}
......
......@@ -39,11 +39,11 @@ void _updateWindowMetrics(double devicePixelRatio,
_invoke(window.onMetricsChanged, window._onMetricsChangedZone);
}
typedef String LocaleClosure();
typedef String _LocaleClosure();
String _localeClosure() => window._locale.toString();
LocaleClosure _getLocaleClosure() => _localeClosure;
_LocaleClosure _getLocaleClosure() => _localeClosure;
void _updateLocale(String languageCode, String countryCode) {
window._locale = new Locale(languageCode, countryCode);
......@@ -133,7 +133,7 @@ void _invoke1<A>(void callback(A a), Zone zone, A arg) {
if (identical(zone, Zone.current)) {
callback(arg);
} else {
zone.runUnaryGuarded<Null, A>(callback, arg);
zone.runUnaryGuarded<A>(callback, arg);
}
}
......@@ -147,7 +147,7 @@ void _invoke2<A1, A2>(void callback(A1 a1, A2 a2), Zone zone, A1 arg1, A2 arg2)
if (identical(zone, Zone.current)) {
callback(arg1, arg2);
} else {
zone.runBinaryGuarded<Null, A1, A2>(callback, arg1, arg2);
zone.runBinaryGuarded<A1, A2>(callback, arg1, arg2);
}
}
......@@ -178,7 +178,7 @@ PointerDataPacket _unpackPointerDataPacket(ByteData packet) {
const int kBytesPerPointerData = _kPointerDataFieldCount * kStride;
final int length = packet.lengthInBytes ~/ kBytesPerPointerData;
assert(length * kBytesPerPointerData == packet.lengthInBytes);
List<PointerData> data = new List<PointerData>(length);
final List<PointerData> data = new List<PointerData>(length);
for (int i = 0; i < length; ++i) {
int offset = i * _kPointerDataFieldCount;
data[i] = new PointerData(
......
......@@ -8,9 +8,7 @@ part of dart.ui;
double lerpDouble(num a, num b, double t) {
if (a == null && b == null)
return null;
if (a == null)
a = 0.0;
if (b == null)
b = 0.0;
a ??= 0.0;
b ??= 0.0;
return a + (b - a) * t;
}
......@@ -10,7 +10,7 @@ void _print(dynamic arg) {
}
class _Logger {
static void _printString(String s) native "Logger_PrintString";
static void _printString(String s) native 'Logger_PrintString';
}
// A service protocol extension to schedule a frame to be rendered into the
......@@ -22,7 +22,7 @@ Future<developer.ServiceExtensionResponse> _scheduleFrame(
// Schedule the frame.
window.scheduleFrame();
// Always succeed.
return new developer.ServiceExtensionResponse.result(JSON.encode({
return new developer.ServiceExtensionResponse.result(JSON.encode(<String, String>{
'type': 'Success',
}));
}
......@@ -35,7 +35,7 @@ void _setupHooks() {
}());
}
void _scheduleMicrotask(void callback()) native "ScheduleMicrotask";
void _scheduleMicrotask(void callback()) native 'ScheduleMicrotask';
String _baseURL;
Uri _getBaseURL() => Uri.parse(_baseURL);
......@@ -51,5 +51,5 @@ Function _getGetBaseURLClosure() => _getBaseURL;
// above, the builtin library will be included manually during VM setup. This
// symbol is only necessary for precompilation. It is marked as a stanalone
// entry point into the VM. This prevents the precompiler from tree shaking
// away "main"
// away "main".
Function _getMainClosure() => main;
此差异已折叠。
......@@ -265,7 +265,7 @@ class SemanticsFlag {
class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
/// Creates an empty [SemanticsUpdateBuilder] object.
SemanticsUpdateBuilder() { _constructor(); }
void _constructor() native "SemanticsUpdateBuilder_constructor";
void _constructor() native 'SemanticsUpdateBuilder_constructor';
/// Update the information associated with the node with the given `id`.
///
......@@ -310,25 +310,27 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
String decreasedValue,
TextDirection textDirection,
Float64List transform,
Int32List children
Int32List children,
}) {
if (transform.length != 16)
throw new ArgumentError('transform argument must have 16 entries.');
_updateNode(id,
flags,
actions,
rect.left,
rect.top,
rect.right,
rect.bottom,
label,
hint,
value,
increasedValue,
decreasedValue,
textDirection != null ? textDirection.index + 1 : 0,
transform,
children);
_updateNode(
id,
flags,
actions,
rect.left,
rect.top,
rect.right,
rect.bottom,
label,
hint,
value,
increasedValue,
decreasedValue,
textDirection != null ? textDirection.index + 1 : 0,
transform,
children,
);
}
void _updateNode(
int id,
......@@ -345,15 +347,15 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
String decreasedValue,
int textDirection,
Float64List transform,
Int32List children
) native "SemanticsUpdateBuilder_updateNode";
Int32List children,
) native 'SemanticsUpdateBuilder_updateNode';
/// Creates a [SemanticsUpdate] object that encapsulates the updates recorded
/// by this object.
///
/// The returned object can be passed to [Window.updateSemantics] to actually
/// update the semantics retained by the system.
SemanticsUpdate build() native "SemanticsUpdateBuilder_build";
SemanticsUpdate build() native 'SemanticsUpdateBuilder_build';
}
/// An opaque object representing a batch of semantics updates.
......@@ -373,5 +375,5 @@ class SemanticsUpdate extends NativeFieldWrapperClass2 {
///
/// After calling this function, the semantics update is cannot be used
/// further.
void dispose() native "SemanticsUpdateBuilder_dispose";
void dispose() native 'SemanticsUpdateBuilder_dispose';
}
......@@ -54,7 +54,7 @@ class FontWeight {
static const FontWeight bold = w700;
/// A list of all the font weights.
static const List<FontWeight> values = const [
static const List<FontWeight> values = const <FontWeight>[
w100, w200, w300, w400, w500, w600, w700, w800, w900
];
......@@ -83,6 +83,7 @@ class FontWeight {
return values[lerpDouble(a?.index ?? normal.index, b?.index ?? normal.index, t).round().clamp(0, 8)];
}
@override
String toString() {
return const <int, String>{
0: 'FontWeight.w100',
......@@ -133,10 +134,10 @@ enum TextAlign {
/// A horizontal line used for aligning text.
enum TextBaseline {
// The horizontal line used to align the bottom of glyphs for alphabetic characters.
/// The horizontal line used to align the bottom of glyphs for alphabetic characters.
alphabetic,
// The horizontal line used to align ideographic characters.
/// The horizontal line used to align ideographic characters.
ideographic,
}
......@@ -186,7 +187,7 @@ class TextDecoration {
String toString() {
if (_mask == 0)
return 'TextDecoration.none';
List<String> values = <String>[];
final List<String> values = <String>[];
if (_mask & underline._mask != 0)
values.add('underline');
if (_mask & overline._mask != 0)
......@@ -242,19 +243,21 @@ enum TextDecorationStyle {
//
// - Element 7: The enum index of the |textBaseline|.
//
Int32List _encodeTextStyle(Color color,
TextDecoration decoration,
Color decorationColor,
TextDecorationStyle decorationStyle,
FontWeight fontWeight,
FontStyle fontStyle,
TextBaseline textBaseline,
String fontFamily,
double fontSize,
double letterSpacing,
double wordSpacing,
double height) {
Int32List result = new Int32List(8);
Int32List _encodeTextStyle(
Color color,
TextDecoration decoration,
Color decorationColor,
TextDecorationStyle decorationStyle,
FontWeight fontWeight,
FontStyle fontStyle,
TextBaseline textBaseline,
String fontFamily,
double fontSize,
double letterSpacing,
double wordSpacing,
double height,
) {
final Int32List result = new Int32List(8);
if (color != null) {
result[0] |= 1 << 1;
result[1] = color.value;
......@@ -334,19 +337,21 @@ class TextStyle {
double fontSize,
double letterSpacing,
double wordSpacing,
double height
}) : _encoded = _encodeTextStyle(color,
decoration,
decorationColor,
decorationStyle,
fontWeight,
fontStyle,
textBaseline,
fontFamily,
fontSize,
letterSpacing,
wordSpacing,
height),
double height,
}) : _encoded = _encodeTextStyle(
color,
decoration,
decorationColor,
decorationStyle,
fontWeight,
fontStyle,
textBaseline,
fontFamily,
fontSize,
letterSpacing,
wordSpacing,
height,
),
_fontFamily = fontFamily ?? '',
_fontSize = fontSize,
_letterSpacing = letterSpacing,
......@@ -360,6 +365,7 @@ class TextStyle {
final double _wordSpacing;
final double _height;
@override
bool operator ==(dynamic other) {
if (identical(this, other))
return true;
......@@ -379,8 +385,10 @@ class TextStyle {
return true;
}
@override
int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _letterSpacing, _wordSpacing, _height);
@override
String toString() {
return 'TextStyle('
'color: ${ _encoded[0] & 0x0002 == 0x0002 ? new Color(_encoded[1]) : "unspecified"}, '
......@@ -416,16 +424,18 @@ class TextStyle {
//
// - Element 4: The value of |maxLines|.
//
Int32List _encodeParagraphStyle(TextAlign textAlign,
TextDirection textDirection,
FontWeight fontWeight,
FontStyle fontStyle,
int maxLines,
String fontFamily,
double fontSize,
double lineHeight,
String ellipsis) {
Int32List result = new Int32List(6); // also update paragraph_builder.cc
Int32List _encodeParagraphStyle(
TextAlign textAlign,
TextDirection textDirection,
FontWeight fontWeight,
FontStyle fontStyle,
int maxLines,
String fontFamily,
double fontSize,
double lineHeight,
String ellipsis,
) {
final Int32List result = new Int32List(6); // also update paragraph_builder.cc
if (textAlign != null) {
result[0] |= 1 << 1;
result[1] = textAlign.index;
......@@ -521,15 +531,17 @@ class ParagraphStyle {
double fontSize,
double lineHeight,
String ellipsis,
}) : _encoded = _encodeParagraphStyle(textAlign,
textDirection,
fontWeight,
fontStyle,
maxLines,
fontFamily,
fontSize,
lineHeight,
ellipsis),
}) : _encoded = _encodeParagraphStyle(
textAlign,
textDirection,
fontWeight,
fontStyle,
maxLines,
fontFamily,
fontSize,
lineHeight,
ellipsis,
),
_fontFamily = fontFamily,
_fontSize = fontSize,
_lineHeight = lineHeight,
......@@ -541,6 +553,7 @@ class ParagraphStyle {
final double _lineHeight;
final String _ellipsis;
@override
bool operator ==(dynamic other) {
if (identical(this, other))
return true;
......@@ -559,8 +572,10 @@ class ParagraphStyle {
return true;
}
@override
int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _lineHeight, _ellipsis);
@override
String toString() {
return '$runtimeType('
'textAlign: ${ _encoded[0] & 0x002 == 0x002 ? TextAlign.values[_encoded[1]] : "unspecified"}, '
......@@ -828,9 +843,9 @@ class ParagraphConstraints {
/// Creates constraints for laying out a pargraph.
///
/// The [width] argument must not be null.
ParagraphConstraints({ this.width }) {
assert(width != null);
}
ParagraphConstraints({
this.width,
}) : assert(width != null);
/// The width the paragraph should use whey computing the positions of glyphs.
///
......@@ -885,32 +900,32 @@ abstract class Paragraph extends NativeFieldWrapperClass2 {
/// The amount of horizontal space this paragraph occupies.
///
/// Valid only after [layout] has been called.
double get width native "Paragraph_width";
double get width native 'Paragraph_width';
/// The amount of vertical space this paragraph occupies.
///
/// Valid only after [layout] has been called.
double get height native "Paragraph_height";
double get height native 'Paragraph_height';
/// The minimum width that this paragraph could be without failing to paint
/// its contents within itself.
///
/// Valid only after [layout] has been called.
double get minIntrinsicWidth native "Paragraph_minIntrinsicWidth";
double get minIntrinsicWidth native 'Paragraph_minIntrinsicWidth';
/// Returns the smallest width beyond which increasing the width never
/// decreases the height.
///
/// Valid only after [layout] has been called.
double get maxIntrinsicWidth native "Paragraph_maxIntrinsicWidth";
double get maxIntrinsicWidth native 'Paragraph_maxIntrinsicWidth';
/// The distance from the top of the paragraph to the alphabetic
/// baseline of the first line, in logical pixels.
double get alphabeticBaseline native "Paragraph_alphabeticBaseline";
double get alphabeticBaseline native 'Paragraph_alphabeticBaseline';
/// The distance from the top of the paragraph to the ideographic
/// baseline of the first line, in logical pixels.
double get ideographicBaseline native "Paragraph_ideographicBaseline";
double get ideographicBaseline native 'Paragraph_ideographicBaseline';
/// True if there is more vertical content, but the text was truncated, either
/// because we reached `maxLines` lines of text or because the `maxLines` was
......@@ -919,35 +934,35 @@ abstract class Paragraph extends NativeFieldWrapperClass2 {
///
/// See the discussion of the `maxLines` and `ellipsis` arguments at [new
/// ParagraphStyle].
bool get didExceedMaxLines native "Paragraph_didExceedMaxLines";
bool get didExceedMaxLines native 'Paragraph_didExceedMaxLines';
/// Computes the size and position of each glyph in the paragraph.
///
/// The [ParagraphConstraints] control how wide the text is allowed to be.
void layout(ParagraphConstraints constraints) => _layout(constraints.width);
void _layout(double width) native "Paragraph_layout";
void _layout(double width) native 'Paragraph_layout';
/// Returns a list of text boxes that enclose the given text range.
List<TextBox> getBoxesForRange(int start, int end) native "Paragraph_getRectsForRange";
List<TextBox> getBoxesForRange(int start, int end) native 'Paragraph_getRectsForRange';
/// Returns the text position closest to the given offset.
TextPosition getPositionForOffset(Offset offset) {
List<int> encoded = _getPositionForOffset(offset.dx, offset.dy);
final List<int> encoded = _getPositionForOffset(offset.dx, offset.dy);
return new TextPosition(offset: encoded[0], affinity: TextAffinity.values[encoded[1]]);
}
List<int> _getPositionForOffset(double dx, double dy) native "Paragraph_getPositionForOffset";
List<int> _getPositionForOffset(double dx, double dy) native 'Paragraph_getPositionForOffset';
/// Returns the [start, end] of the word at the given offset. Characters not
/// part of a word, such as spaces, symbols, and punctuation, have word breaks
/// on both sides. In such cases, this method will return [offset, offset+1].
/// Word boundaries are defined more precisely in Unicode Standard Annex #29
/// http://www.unicode.org/reports/tr29/#Word_Boundaries
List<int> getWordBoundary(int offset) native "Paragraph_getWordBoundary";
List<int> getWordBoundary(int offset) native 'Paragraph_getWordBoundary';
// Redirecting the paint function in this way solves some dependency problems
// in the C++ code. If we straighten out the C++ dependencies, we can remove
// this indirection.
void _paint(Canvas canvas, double x, double y) native "Paragraph_paint";
void _paint(Canvas canvas, double x, double y) native 'Paragraph_paint';
}
/// Builds a [Paragraph] containing text with the given styling information.
......@@ -968,13 +983,13 @@ class ParagraphBuilder extends NativeFieldWrapperClass2 {
/// Creates a [ParagraphBuilder] object, which is used to create a
/// [Paragraph].
ParagraphBuilder(ParagraphStyle style) { _constructor(style._encoded, style._fontFamily, style._fontSize, style._lineHeight, style._ellipsis); }
void _constructor(Int32List encoded, String fontFamily, double fontSize, double lineHeight, String ellipsis) native "ParagraphBuilder_constructor";
void _constructor(Int32List encoded, String fontFamily, double fontSize, double lineHeight, String ellipsis) native 'ParagraphBuilder_constructor';
/// Applies the given style to the added text until [pop] is called.
///
/// See [pop] for details.
void pushStyle(TextStyle style) => _pushStyle(style._encoded, style._fontFamily, style._fontSize, style._letterSpacing, style._wordSpacing, style._height);
void _pushStyle(Int32List encoded, String fontFamily, double fontSize, double letterSpacing, double wordSpacing, double height) native "ParagraphBuilder_pushStyle";
void _pushStyle(Int32List encoded, String fontFamily, double fontSize, double letterSpacing, double wordSpacing, double height) native 'ParagraphBuilder_pushStyle';
/// Ends the effect of the most recent call to [pushStyle].
///
......@@ -982,22 +997,22 @@ class ParagraphBuilder extends NativeFieldWrapperClass2 {
/// added to the paragraph is affected by all the styles in the stack. Calling
/// [pop] removes the topmost style in the stack, leaving the remaining styles
/// in effect.
void pop() native "ParagraphBuilder_pop";
void pop() native 'ParagraphBuilder_pop';
/// Adds the given text to the paragraph.
///
/// The text will be styled according to the current stack of text styles.
void addText(String text) {
String error = _addText(text);
final String error = _addText(text);
if (error != null)
throw new ArgumentError(error);
}
String _addText(String text) native "ParagraphBuilder_addText";
String _addText(String text) native 'ParagraphBuilder_addText';
/// Applies the given paragraph style and returns a [Paragraph] containing the
/// added text and associated styling.
///
/// After calling this function, the paragraph builder object is invalid and
/// cannot be used further.
Paragraph build() native "ParagraphBuilder_build";
Paragraph build() native 'ParagraphBuilder_build';
}
......@@ -530,7 +530,7 @@ class Window {
/// The route or path that the operating system requested when the application
/// was launched.
String get defaultRouteName => _defaultRouteName();
String _defaultRouteName() native "Window_defaultRouteName";
String _defaultRouteName() native 'Window_defaultRouteName';
/// Requests that, at the next appropriate opportunity, the [onBeginFrame]
/// and [onDrawFrame] callbacks be invoked.
......@@ -539,7 +539,7 @@ class Window {
///
/// * [SchedulerBinding], the Flutter framework class which manages the
/// scheduling of frames.
void scheduleFrame() native "Window_scheduleFrame";
void scheduleFrame() native 'Window_scheduleFrame';
/// Updates the application's rendering on the GPU with the newly provided
/// [Scene]. This function must be called within the scope of the
......@@ -565,7 +565,7 @@ class Window {
/// scheduling of frames.
/// * [RendererBinding], the Flutter framework class which manages layout and
/// painting.
void render(Scene scene) native "Window_render";
void render(Scene scene) native 'Window_render';
/// Whether the user has requested that [updateSemantics] be called when
/// the semantic contents of window changes.
......@@ -610,7 +610,7 @@ class Window {
///
/// In either case, this function disposes the given update, which means the
/// semantics update cannot be used further.
void updateSemantics(SemanticsUpdate update) native "Window_updateSemantics";
void updateSemantics(SemanticsUpdate update) native 'Window_updateSemantics';
/// Sends a message to a platform-specific plugin.
///
......@@ -628,7 +628,7 @@ class Window {
}
void _sendPlatformMessage(String name,
PlatformMessageResponseCallback callback,
ByteData data) native "Window_sendPlatformMessage";
ByteData data) native 'Window_sendPlatformMessage';
/// Called whenever this window receives a message from a platform-specific
/// plugin.
......@@ -653,7 +653,7 @@ class Window {
/// Called by [_dispatchPlatformMessage].
void _respondToPlatformMessage(int responseId, ByteData data)
native "Window_respondToPlatformMessage";
native 'Window_respondToPlatformMessage';
/// Wraps the given [callback] in another callback that ensures that the
/// original callback is called in the zone it was registered in.
......
......@@ -7,8 +7,8 @@ import 'dart:collection';
Map<Key, dynamic> _cache = new LinkedHashMap<Key, dynamic>();
const int _maxSize = 10;
dynamic/*=T*/ cache/*<T>*/(Key key, dynamic/*=T*/ getter()) {
dynamic/*=T*/ result = _cache[key];
T cache<T>(Key key, T getter()) {
T result = _cache[key];
if (result != null) {
_cache.remove(key);
} else {
......
......@@ -136,6 +136,7 @@ FileType identifyFile(String name, Reader reader) {
case '.dex': return FileType.binary; // Dalvik Executable (usually found inside .jar archives)
// Dart code
case '.dart': return FileType.text;
case '.dill': return FileType.binary; // Compiled Dart code
// LLVM bitcode
case '.bc': return FileType.binary;
// Python code
......@@ -178,7 +179,8 @@ FileType identifyFile(String name, Reader reader) {
case '.apk': return FileType.zip; // Android Package
case '.crx': return FileType.binary; // Chrome extension
case '.keystore': return FileType.binary;
case '.icc': return FileType.binary;
case '.icc': return FileType.binary; // Color profile
case '.swp': return FileType.binary; // Vim swap file
// Archives
case '.zip': return FileType.zip; // ZIP
case '.tar': return FileType.tar; // Tar
......
......@@ -52,7 +52,7 @@ abstract class RepositoryLicensedFile extends RepositoryFile {
// file names that we are confident won't be included in the final build product
static final RegExp _readmeNamePattern = new RegExp(r'\b_*(?:readme|contributing|patents)_*\b', caseSensitive: false);
static final RegExp _buildTimePattern = new RegExp(r'^(?!.*gen$)(?:CMakeLists\.txt|(?:pkgdata)?Makefile(?:\.inc)?(?:\.am|\.in|)|configure(?:\.ac|\.in)?|config\.(?:sub|guess)|.+\.m4|install-sh|.+\.sh|.+\.bat|.+\.pyc?|.+\.pl|icu-configure|.+\.gypi?|.*\.gni?|.+\.mk|.+\.cmake|.+\.gradle|.+\.yaml|vms_make\.com|pom\.xml|\.project|source\.properties)$', caseSensitive: false);
static final RegExp _buildTimePattern = new RegExp(r'^(?!.*gen$)(?:CMakeLists\.txt|(?:pkgdata)?Makefile(?:\.inc)?(?:\.am|\.in|)|configure(?:\.ac|\.in)?|config\.(?:sub|guess)|.+\.m4|install-sh|.+\.sh|.+\.bat|.+\.pyc?|.+\.pl|icu-configure|.+\.gypi?|.*\.gni?|.+\.mk|.+\.cmake|.+\.gradle|.+\.yaml|pubspec\.lock|\.packages|vms_make\.com|pom\.xml|\.project|source\.properties)$', caseSensitive: false);
static final RegExp _docsPattern = new RegExp(r'^(?:INSTALL|NEWS|OWNERS|AUTHORS|ChangeLog(?:\.rst|\.[0-9]+)?|.+\.txt|.+\.md|.+\.log|.+\.css|.+\.1|doxygen\.config|.+\.spec(?:\.in)?)$', caseSensitive: false);
static final RegExp _devPattern = new RegExp(r'^(?:codereview\.settings|.+\.~|.+\.~[0-9]+~|\.clang-format|\.gitattributes|\.landmines|\.DS_Store|\.travis\.yml)$', caseSensitive: false);
static final RegExp _testsPattern = new RegExp(r'^(?:tj(?:bench|example)test\.(?:java\.)?in|example\.c)$', caseSensitive: false);
......
......@@ -2,52 +2,60 @@
# See http://pub.dartlang.org/doc/glossary.html#lockfile
packages:
archive:
dependency: "direct main"
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.27"
version: "1.0.33"
args:
dependency: "direct main"
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.7"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.1"
version: "1.14.5"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
crypto:
dependency: "direct main"
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.2+1"
path:
dependency: "direct main"
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
version: "1.5.1"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
version: "1.1.5"
sdks:
dart: ">=1.17.0-dev.6.2 <2.0.0"
dart: ">=1.21.0 <=2.0.0-dev.16.0"
......@@ -3,4 +3,4 @@ dependencies:
path: ^1.3.0
archive: ^1.0.24
args: 0.13.7
crypto: ^2.0.1
crypto: ^2.0.2+1
echo "Analyzing frontend_server..."
RESULTS=`dartanalyzer \
--packages=flutter/frontend_server/.packages \
--options flutter/analysis_options.yaml \
flutter/frontend_server \
2>&1 \
| grep -Ev "No issues found!" \
| grep -Ev "Analyzing.+frontend_server"`
echo "$RESULTS"
if [ -n "$RESULTS" ]; then
echo "Failed."
exit 1;
fi
echo "Analyzing dart:ui library..."
RESULTS=`dartanalyzer \
--supermixin \
--enable-assert-initializers \
--initializing-formal-access \
--enable-strict-call-checks \
--enable_type_checks \
--strong \
--no-implicit-dynamic \
--package-warnings \
--fatal-warnings \
--fatal-hints \
--lints \
--fatal-lints \
--options flutter/analysis_options.yaml \
out/host_debug_unopt/gen/sky/bindings/dart_ui/ui.dart \
2>&1 \
| grep -v "Native functions can only be declared in the SDK and code that is loaded through native extensions" \
| grep -Ev "The function '.+' (is not|isn't) used" \
| grep -Ev "The top level variable '.+' isn't used" \
| grep -Ev "Undefined name 'main'" \
| grep -Ev "Undefined name 'VMLibraryHooks" \
| grep -v "The library ''dart:_internal'' is internal" \
| grep -v "The library 'dart:_internal' is internal" \
| grep -Ev "Unused import.+ui\.dart" \
| grep -v "TODO" \
| grep -Ev "[0-9]+ errors.*found\." \
| grep -Ev "Analyzing.+out/host_debug_unopt/gen/sky/bindings/dart_ui/ui\.dart"`
......@@ -43,3 +17,18 @@ if [ -n "$RESULTS" ]; then
echo "Failed."
exit 1;
fi
echo "Analyzing frontend_server..."
pushd flutter/frontend_server/; pub get; popd
RESULTS=`dartanalyzer \
--packages=flutter/frontend_server/.packages \
--options flutter/analysis_options.yaml \
flutter/frontend_server \
2>&1 \
| grep -Ev "No issues found!" \
| grep -Ev "Analyzing.+frontend_server"`
echo "$RESULTS"
if [ -n "$RESULTS" ]; then
echo "Failed."
exit 1;
fi
......@@ -1259,7 +1259,6 @@ ORIGIN: ../../../LICENSE
TYPE: LicenseType.bsd
FILE: ../../../flutter/DEPS
FILE: ../../../flutter/content_handler/meta/sandbox
FILE: ../../../flutter/frontend_server/.packages
FILE: ../../../flutter/frontend_server/bin/starter.dart
FILE: ../../../flutter/frontend_server/lib/server.dart
FILE: ../../../flutter/lib/io/dart_io.cc
......
Signature: 73b746018e6b1764c2596c44e2e81e28
Signature: 5eac0d88d1c8ffe7fc4768fb2eefb1eb
UNUSED LICENSES:
......@@ -4187,13 +4187,11 @@ FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Def
FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml
FILE: ../../../third_party/dart/runtime/CPPLINT.cfg
FILE: ../../../third_party/dart/runtime/observatory/.analysis_options
FILE: ../../../third_party/dart/runtime/observatory/.packages
FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png
FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/isolate_icon.png
FILE: ../../../third_party/dart/runtime/observatory/maintainers/pubspec.template
FILE: ../../../third_party/dart/runtime/observatory/pubspec.lock
FILE: ../../../third_party/dart/runtime/observatory/web/favicon.ico
FILE: ../../../third_party/dart/runtime/observatory/web/index.html
FILE: ../../../third_party/dart/runtime/observatory/web/third_party/trace_viewer_full.html
......@@ -4201,7 +4199,6 @@ FILE: ../../../third_party/dart/runtime/observatory/web/timeline.html
FILE: ../../../third_party/dart/runtime/vm/snapshot_test_in.dat
FILE: ../../../third_party/dart/samples/build_dart/test.foo
FILE: ../../../third_party/dart/samples/build_dart_simple/test.foo
FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/.packages
FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions_dart2js.dart
FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common.dart
FILE: ../../../third_party/dart/sdk/lib/libraries.json
......@@ -4717,7 +4714,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
LIBRARY: dart
ORIGIN: ../../../third_party/dart/runtime/bin/crypto_fuchsia.cc + ../../../third_party/dart/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/dart/.packages
FILE: ../../../third_party/dart/runtime/bin/crypto_fuchsia.cc
FILE: ../../../third_party/dart/runtime/bin/crypto_test.cc
FILE: ../../../third_party/dart/runtime/bin/directory_fuchsia.cc
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册