diff --git a/.gitattributes b/.gitattributes index 49b40f1f676..c4729ecd788 100644 --- a/.gitattributes +++ b/.gitattributes @@ -42,12 +42,8 @@ tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart -text tests/lib_2/mirrors/method_mirror_source_test.dart -text tests/lib_2/mirrors/method_mirror_source_other.dart -text tests/language_strong/multiline_newline_crlf.dart -text -tests/lib_2/mirrors/method_mirror_source_line_ending_test.dart -text -tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart -text -tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart -text -tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart -text -tests/lib_2/mirrors/method_mirror_source_test.dart -text -tests/lib_2/mirrors/method_mirror_source_other.dart -text +tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart -text +tests/lib_strong/mirrors/method_mirror_source_line_ending_crlf.dart -text # Files to leave alone and not diff. *.png binary diff --git a/tests/lib_2/lib_2_dart2js.status b/tests/lib_2/lib_2_dart2js.status index e3f8fda90b9..41d4f901c65 100644 --- a/tests/lib_2/lib_2_dart2js.status +++ b/tests/lib_2/lib_2_dart2js.status @@ -24,30 +24,9 @@ async/future_or_strong_test: RuntimeError math/random_big_test: RuntimeError # Using bigint seeds for random. mirrors/*: SkipByDesign # Mirrors not supported on web in Dart 2.0. convert/chunked_conversion_utf88_test: Slow, Pass -mirrors/metadata_scope_test/none: RuntimeError # Issue 10905 -mirrors/method_mirror_name_test: RuntimeError # Issue 6335 -mirrors/method_mirror_properties_test: RuntimeError # Issue 11861 -mirrors/method_mirror_source_test : RuntimeError # Issue 6490 -mirrors/method_mirror_source_line_ending_test : RuntimeError # Issue 6490 -mirrors/method_mirror_location_test: RuntimeError # Issue 6490 [ $compiler == dart2js ] async/future_or_strong_test: RuntimeError [ $compiler != dart2js ] async/dart2js_uncaught_error_test: Skip # JS-integration only test - -[ $compiler == dart2js && $fast_startup ] -mirrors/metadata_allowed_values_test/0*: Pass # expects failure, but it fails for the wrong reason -mirrors/metadata_allowed_values_test/1*: Pass # expects failure, but it fails for the wrong reason -mirrors/metadata_allowed_values_test/2*: Pass # expects failure, but it fails for the wrong reason -mirrors/metadata_allowed_values_test/3*: Pass # expects failure, but it fails for the wrong reason -mirrors/metadata_constructor_arguments_test/0*: Pass # expects failure, but it fails for the wrong reason -mirrors/metadata_nested_constructor_call_test/0*: Pass # expects failure, but it fails for the wrong reason -mirrors/metadata_scope_test/01: Pass # expects failure, but it fails for the wrong reason - -[ $compiler == dart2js && $host_checked ] -mirrors/metadata_allowed_values_test/28: Crash # Issue 25911 -mirrors/metadata_allowed_values_test/29: Crash # Issue 25911 -mirrors/metadata_allowed_values_test/30: Crash # Issue 25911 -mirrors/metadata_allowed_values_test/31: Crash # Issue 25911 diff --git a/tests/lib_2/lib_2_dartdevc.status b/tests/lib_2/lib_2_dartdevc.status index df3075675a4..a515e088031 100644 --- a/tests/lib_2/lib_2_dartdevc.status +++ b/tests/lib_2/lib_2_dartdevc.status @@ -13,10 +13,3 @@ async/futures_test: RuntimeError # Issue 29922 async/slow_consumer_test: Pass, Timeout # Issue 29922 math/random_big_test: RuntimeError # Issue 29922 typed_data/typed_data_list_test: RuntimeError # Issue 29922 -mirrors/local_isolate_test: RuntimeError # Issue 29922 -mirrors/metadata_constructed_constant_test: RuntimeError # Issue 29922 -mirrors/metadata_test: RuntimeError # Issue 29922 -mirrors/method_mirror_location_test: RuntimeError # Issue 29922 -mirrors/method_mirror_returntype_test: RuntimeError # Issue 29922 -mirrors/method_mirror_source_line_ending_test: RuntimeError # Issue 29922 -mirrors/method_mirror_source_test: RuntimeError # Issue 29922 diff --git a/tests/lib_2/lib_2_kernel.status b/tests/lib_2/lib_2_kernel.status index 76bc14d3482..1924b004e17 100644 --- a/tests/lib_2/lib_2_kernel.status +++ b/tests/lib_2/lib_2_kernel.status @@ -27,17 +27,6 @@ mirrors/deferred_mirrors_update_test: CompileTimeError # Deferred loading kernel mirrors/generic_mixin_applications_test: RuntimeError mirrors/generic_mixin_test: RuntimeError mirrors/mirrors_test: Crash -mirrors/metadata_allowed_values_test/02: MissingCompileTimeError -mirrors/metadata_allowed_values_test/13: MissingCompileTimeError -mirrors/metadata_allowed_values_test/14: MissingCompileTimeError -mirrors/metadata_allowed_values_test/16: Skip # Flaky, crashes. -mirrors/metadata_allowed_values_test/27: Crash -mirrors/metadata_constructed_constant_test: Crash -mirrors/metadata_constructor_arguments_test/04: MissingCompileTimeError -mirrors/metadata_scope_test/none: RuntimeError -mirrors/method_mirror_location_test: RuntimeError -mirrors/method_mirror_source_line_ending_test: Crash -mirrors/method_mirror_source_test: Crash [ $compiler == dartk && $runtime == vm ] mirrors/class_mirror_location_test: RuntimeError @@ -53,7 +42,3 @@ mirrors/empty_test: RuntimeError mirrors/equality_test: RuntimeError mirrors/generic_mixin_applications_test: RuntimeError mirrors/generic_mixin_test: RuntimeError -mirrors/metadata_constructed_constant_test: RuntimeError -mirrors/method_mirror_location_test: RuntimeError -mirrors/method_mirror_source_line_ending_test: Crash -mirrors/method_mirror_source_test: Crash diff --git a/tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart b/tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart deleted file mode 100755 index 45533d47348..00000000000 --- a/tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart +++ /dev/null @@ -1 +0,0 @@ -// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // Note: This test relies on CR line endings in the source file. library line_endings.cr; oneLineCR(x) => x; multiLineCR(y) { return y + 1; } b (){ } diff --git a/tests/lib_strong/lib_strong.status b/tests/lib_strong/lib_strong.status index 07aeb95b316..2a656765db3 100644 --- a/tests/lib_strong/lib_strong.status +++ b/tests/lib_strong/lib_strong.status @@ -91,6 +91,12 @@ mirrors/library_imports_prefixed_test: Skip mirrors/library_imports_shown_test: Skip mirrors/library_metadata2_test: Skip mirrors/load_library_test: Skip +mirrors/metadata_allowed_values_test: Skip +mirrors/metadata_constructor_arguments_test: Skip +mirrors/metadata_nested_constructor_call_test: Skip +mirrors/metadata_scope_test: Skip +mirrors/method_mirror_name_test: Skip +mirrors/method_mirror_properties_test: Skip mirrors/mirror_in_static_init_test: Skip mirrors/mirrors_nsm_mismatch_test: Skip mirrors/mirrors_nsm_test: Skip @@ -245,6 +251,13 @@ mirrors/library_metadata_test: RuntimeError # Issue 29922 mirrors/library_uri_io_test: RuntimeError # Issue 29922 mirrors/library_uri_package_test: RuntimeError # Issue 29922 mirrors/local_function_is_static_test: RuntimeError # Issue 29922 +mirrors/local_isolate_test: RuntimeError # Issue 29922 +mirrors/metadata_constructed_constant_test: RuntimeError # Issue 29922 +mirrors/metadata_test: RuntimeError # Issue 29922 +mirrors/method_mirror_location_test: RuntimeError # Issue 29922 +mirrors/method_mirror_returntype_test: RuntimeError # Issue 29922 +mirrors/method_mirror_source_line_ending_test: RuntimeError # Issue 29922 +mirrors/method_mirror_source_test: RuntimeError # Issue 29922 mirrors/mirrors_reader_test: RuntimeError # Issue 29922 mirrors/mirrors_used_typedef_declaration_test/01: RuntimeError # Issue 29922 mirrors/mirrors_used_typedef_declaration_test/none: RuntimeError # Issue 29922 diff --git a/tests/lib_strong/lib_strong_kernel.status b/tests/lib_strong/lib_strong_kernel.status index e2d5850fb34..53aac83016c 100644 --- a/tests/lib_strong/lib_strong_kernel.status +++ b/tests/lib_strong/lib_strong_kernel.status @@ -201,6 +201,12 @@ mirrors/library_uri_io_test: DartkCompileTimeError mirrors/library_uri_package_test: DartkCompileTimeError mirrors/list_constructor_test/01: RuntimeError mirrors/list_constructor_test/none: RuntimeError +mirrors/metadata_constructed_constant_test: RuntimeError +mirrors/metadata_test: RuntimeError +mirrors/method_mirror_location_test: RuntimeError +mirrors/method_mirror_returntype_test: RuntimeError +mirrors/method_mirror_source_line_ending_test: Crash +mirrors/method_mirror_source_test: Crash mirrors/mirrors_reader_test: Crash mirrors/mirrors_used_typedef_declaration_test/01: RuntimeError mirrors/mirrors_used_typedef_declaration_test/none: RuntimeError diff --git a/tests/lib_2/mirrors/local_isolate_test.dart b/tests/lib_strong/mirrors/local_isolate_test.dart similarity index 100% rename from tests/lib_2/mirrors/local_isolate_test.dart rename to tests/lib_strong/mirrors/local_isolate_test.dart diff --git a/tests/lib_2/mirrors/metadata_allowed_values_import.dart b/tests/lib_strong/mirrors/metadata_allowed_values_import.dart similarity index 100% rename from tests/lib_2/mirrors/metadata_allowed_values_import.dart rename to tests/lib_strong/mirrors/metadata_allowed_values_import.dart diff --git a/tests/lib_2/mirrors/metadata_allowed_values_test.dart b/tests/lib_strong/mirrors/metadata_allowed_values_test.dart similarity index 100% rename from tests/lib_2/mirrors/metadata_allowed_values_test.dart rename to tests/lib_strong/mirrors/metadata_allowed_values_test.dart diff --git a/tests/lib_2/mirrors/metadata_class_mirror_test.dart b/tests/lib_strong/mirrors/metadata_class_mirror_test.dart similarity index 91% rename from tests/lib_2/mirrors/metadata_class_mirror_test.dart rename to tests/lib_strong/mirrors/metadata_class_mirror_test.dart index 9391f1ea080..aacb041cd8e 100644 --- a/tests/lib_2/mirrors/metadata_class_mirror_test.dart +++ b/tests/lib_strong/mirrors/metadata_class_mirror_test.dart @@ -4,9 +4,6 @@ // Regression test for http://dartbug.com/19173 -library lib; - -@MirrorsUsed(targets: "lib") import 'dart:mirrors'; class A { diff --git a/tests/lib_2/mirrors/metadata_const_map_test.dart b/tests/lib_strong/mirrors/metadata_const_map_test.dart similarity index 100% rename from tests/lib_2/mirrors/metadata_const_map_test.dart rename to tests/lib_strong/mirrors/metadata_const_map_test.dart diff --git a/tests/lib_2/mirrors/metadata_constructed_constant_test.dart b/tests/lib_strong/mirrors/metadata_constructed_constant_test.dart similarity index 91% rename from tests/lib_2/mirrors/metadata_constructed_constant_test.dart rename to tests/lib_strong/mirrors/metadata_constructed_constant_test.dart index 7d0bf487d26..afcd044ca54 100644 --- a/tests/lib_2/mirrors/metadata_constructed_constant_test.dart +++ b/tests/lib_strong/mirrors/metadata_constructed_constant_test.dart @@ -5,7 +5,6 @@ library test.metadata_constructed_constant_test; -@MirrorsUsed(targets: "test.metadata_constructed_constant_test") import 'dart:mirrors'; import 'package:expect/expect.dart'; diff --git a/tests/lib_2/mirrors/metadata_constructor_arguments_test.dart b/tests/lib_strong/mirrors/metadata_constructor_arguments_test.dart similarity index 96% rename from tests/lib_2/mirrors/metadata_constructor_arguments_test.dart rename to tests/lib_strong/mirrors/metadata_constructor_arguments_test.dart index 3b1bb24d4d3..bc459e911ae 100644 --- a/tests/lib_2/mirrors/metadata_constructor_arguments_test.dart +++ b/tests/lib_strong/mirrors/metadata_constructor_arguments_test.dart @@ -7,7 +7,6 @@ library test.metadata_constructor_arguments; -@MirrorsUsed(targets: "test.metadata_constructor_arguments") import 'dart:mirrors'; import 'package:expect/expect.dart'; diff --git a/tests/lib_2/mirrors/metadata_nested_constructor_call_test.dart b/tests/lib_strong/mirrors/metadata_nested_constructor_call_test.dart similarity index 96% rename from tests/lib_2/mirrors/metadata_nested_constructor_call_test.dart rename to tests/lib_strong/mirrors/metadata_nested_constructor_call_test.dart index c35e3631304..00bb6c0afa0 100644 --- a/tests/lib_2/mirrors/metadata_nested_constructor_call_test.dart +++ b/tests/lib_strong/mirrors/metadata_nested_constructor_call_test.dart @@ -7,7 +7,6 @@ library test.metadata_nested_constructor_call; -@MirrorsUsed(targets: "test.metadata_nested_constructor_call") import 'dart:mirrors'; import 'package:expect/expect.dart'; diff --git a/tests/lib_2/mirrors/metadata_scope_test.dart b/tests/lib_strong/mirrors/metadata_scope_test.dart similarity index 97% rename from tests/lib_2/mirrors/metadata_scope_test.dart rename to tests/lib_strong/mirrors/metadata_scope_test.dart index 40a207e6a96..521dee6563a 100644 --- a/tests/lib_2/mirrors/metadata_scope_test.dart +++ b/tests/lib_strong/mirrors/metadata_scope_test.dart @@ -4,7 +4,6 @@ library test.metadata_scope; -@MirrorsUsed(targets: "test.metadata_scope") import 'dart:mirrors'; import 'package:expect/expect.dart'; diff --git a/tests/lib_2/mirrors/metadata_test.dart b/tests/lib_strong/mirrors/metadata_test.dart similarity index 97% rename from tests/lib_2/mirrors/metadata_test.dart rename to tests/lib_strong/mirrors/metadata_test.dart index 5081653d524..2fe04fa810d 100644 --- a/tests/lib_2/mirrors/metadata_test.dart +++ b/tests/lib_strong/mirrors/metadata_test.dart @@ -4,7 +4,6 @@ library test.metadata_test; -@MirrorsUsed(targets: "test.metadata_test") import 'dart:mirrors'; const string = 'a metadata string'; diff --git a/tests/lib_2/mirrors/method_mirror_location_other.dart b/tests/lib_strong/mirrors/method_mirror_location_other.dart similarity index 85% rename from tests/lib_2/mirrors/method_mirror_location_other.dart rename to tests/lib_strong/mirrors/method_mirror_location_other.dart index 1747eb9342f..510e6f707c0 100644 --- a/tests/lib_2/mirrors/method_mirror_location_other.dart +++ b/tests/lib_strong/mirrors/method_mirror_location_other.dart @@ -12,6 +12,6 @@ class ClassInOtherFile { topLevelInOtherFile() {} - spaceIdentedInOtherFile() {} +spaceIdentedInOtherFile() {} - tabIdentedInOtherFile() {} +tabIdentedInOtherFile() {} diff --git a/tests/lib_2/mirrors/method_mirror_location_test.dart b/tests/lib_strong/mirrors/method_mirror_location_test.dart similarity index 90% rename from tests/lib_2/mirrors/method_mirror_location_test.dart rename to tests/lib_strong/mirrors/method_mirror_location_test.dart index 16c0c0fdddd..8f4769549ff 100644 --- a/tests/lib_2/mirrors/method_mirror_location_test.dart +++ b/tests/lib_strong/mirrors/method_mirror_location_test.dart @@ -27,15 +27,14 @@ expectLocation(Mirror mirror, String uriSuffix, int line, int column) { } class ClassInMainFile { - ClassInMainFile(); method() {} } void topLevelInMainFile() {} - spaceIdentedInMainFile() {} - tabIdentedInMainFile() {} +spaceIdentedInMainFile() {} +tabIdentedInMainFile() {} class HasImplicitConstructor {} @@ -61,12 +60,12 @@ main() { // Another part. expectLocation(reflectClass(ClassInOtherFile).declarations[#ClassInOtherFile], - otherSuffix, 8, 3); + otherSuffix, 9, 3); expectLocation( - reflectClass(ClassInOtherFile).declarations[#method], otherSuffix, 10, 3); - expectLocation(reflect(topLevelInOtherFile), otherSuffix, 13, 1); - expectLocation(reflect(spaceIdentedInOtherFile), otherSuffix, 15, 3); - expectLocation(reflect(tabIdentedInOtherFile), otherSuffix, 17, 2); + reflectClass(ClassInOtherFile).declarations[#method], otherSuffix, 11, 3); + expectLocation(reflect(topLevelInOtherFile), otherSuffix, 14, 1); + expectLocation(reflect(spaceIdentedInOtherFile), otherSuffix, 16, 3); + expectLocation(reflect(tabIdentedInOtherFile), otherSuffix, 18, 2); // Synthetic methods. Expect.isNull(reflectClass(HasImplicitConstructor) diff --git a/tests/lib_2/mirrors/method_mirror_name_test.dart b/tests/lib_strong/mirrors/method_mirror_name_test.dart similarity index 82% rename from tests/lib_2/mirrors/method_mirror_name_test.dart rename to tests/lib_strong/mirrors/method_mirror_name_test.dart index 1f6b94897a9..cec96a7f2ac 100644 --- a/tests/lib_2/mirrors/method_mirror_name_test.dart +++ b/tests/lib_strong/mirrors/method_mirror_name_test.dart @@ -2,9 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -library lib; - -@MirrorsUsed(targets: "lib") import "dart:mirrors"; import "package:expect/expect.dart"; @@ -14,7 +11,7 @@ doNothing42() {} main() { // Regression test for http://www.dartbug.com/6335 - var closureMirror = reflect(doNothing42) as ClosureMirror; + var closureMirror = reflect(doNothing42); Expect.equals( stringifySymbol(closureMirror.function.simpleName), "s(doNothing42)"); } diff --git a/tests/lib_2/mirrors/method_mirror_properties_test.dart b/tests/lib_strong/mirrors/method_mirror_properties_test.dart similarity index 93% rename from tests/lib_2/mirrors/method_mirror_properties_test.dart rename to tests/lib_strong/mirrors/method_mirror_properties_test.dart index ef1212f3105..02ba7c35cdc 100644 --- a/tests/lib_2/mirrors/method_mirror_properties_test.dart +++ b/tests/lib_strong/mirrors/method_mirror_properties_test.dart @@ -2,9 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -library lib; - -@MirrorsUsed(targets: "lib") import "dart:mirrors"; import "package:expect/expect.dart"; @@ -47,9 +44,9 @@ checkKinds(method, kinds) { main() { // Top level functions should be static. - var closureMirror = reflect(doNothing42) as ClosureMirror; + var closureMirror = reflect(doNothing42); checkKinds(closureMirror.function, [true, false, false, false, false]); - var libraryMirror = reflectClass(C).owner as LibraryMirror; + var libraryMirror = reflectClass(C).owner; checkKinds(libraryMirror.declarations[#topGetter], [true, false, true, false, false]); checkKinds(libraryMirror.declarations[const Symbol("topSetter=")], diff --git a/tests/lib_2/mirrors/method_mirror_returntype_test.dart b/tests/lib_strong/mirrors/method_mirror_returntype_test.dart similarity index 97% rename from tests/lib_2/mirrors/method_mirror_returntype_test.dart rename to tests/lib_strong/mirrors/method_mirror_returntype_test.dart index 195c4bf4fb8..362fe76e88a 100644 --- a/tests/lib_2/mirrors/method_mirror_returntype_test.dart +++ b/tests/lib_strong/mirrors/method_mirror_returntype_test.dart @@ -2,9 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -library lib; - -@MirrorsUsed(targets: "lib") import "dart:mirrors"; import "package:expect/expect.dart"; diff --git a/tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart b/tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart new file mode 100755 index 00000000000..d83f6b605f5 --- /dev/null +++ b/tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart @@ -0,0 +1,14 @@ +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Note: This test relies on CR line endings in the source file. + +library line_endings.cr; + +oneLineCR(x) => x; +multiLineCR(y) { + return y + 1; +} + +b() {} diff --git a/tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart b/tests/lib_strong/mirrors/method_mirror_source_line_ending_crlf.dart similarity index 94% rename from tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart rename to tests/lib_strong/mirrors/method_mirror_source_line_ending_crlf.dart index d93615cd83b..1fc3ac0b1c6 100755 --- a/tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart +++ b/tests/lib_strong/mirrors/method_mirror_source_line_ending_crlf.dart @@ -10,6 +10,5 @@ oneLineCRLF(x) => x; multiLineCRLF(y) { return y + 1; } -c -(){ -} + +c() {} diff --git a/tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart b/tests/lib_strong/mirrors/method_mirror_source_line_ending_lf.dart similarity index 97% rename from tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart rename to tests/lib_strong/mirrors/method_mirror_source_line_ending_lf.dart index b805a757a5d..704a745f2bb 100755 --- a/tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart +++ b/tests/lib_strong/mirrors/method_mirror_source_line_ending_lf.dart @@ -10,6 +10,5 @@ oneLineLF(x) => x; multiLineLF(y) { return y + 1; } -a -(){ -} + +a() {} diff --git a/tests/lib_2/mirrors/method_mirror_source_line_ending_test.dart b/tests/lib_strong/mirrors/method_mirror_source_line_ending_test.dart similarity index 100% rename from tests/lib_2/mirrors/method_mirror_source_line_ending_test.dart rename to tests/lib_strong/mirrors/method_mirror_source_line_ending_test.dart diff --git a/tests/lib_2/mirrors/method_mirror_source_other.dart b/tests/lib_strong/mirrors/method_mirror_source_other.dart similarity index 100% rename from tests/lib_2/mirrors/method_mirror_source_other.dart rename to tests/lib_strong/mirrors/method_mirror_source_other.dart diff --git a/tests/lib_2/mirrors/method_mirror_source_test.dart b/tests/lib_strong/mirrors/method_mirror_source_test.dart similarity index 64% rename from tests/lib_2/mirrors/method_mirror_source_test.dart rename to tests/lib_strong/mirrors/method_mirror_source_test.dart index c648ee0b545..cf7ca692d55 100644 --- a/tests/lib_2/mirrors/method_mirror_source_test.dart +++ b/tests/lib_strong/mirrors/method_mirror_source_test.dart @@ -23,18 +23,17 @@ foo1() {} doSomething(e) => e; int get x => 42; -set x(value) { } +set x(value) {} class S {} class C extends S { - var _x; var _y; C(this._x, y) - : _y = y, - super(); + : _y = y, + super(); factory C.other(num z) {} factory C.other2() {} @@ -46,65 +45,64 @@ class C extends S { // Some comment. - void bar() { /* Not so happy bar. */ } + void bar() {/* Not so happy bar. */} - num get someX => - 181; + num get someX => 181; set someX(v) { // Discard this one. } } - main() { // Top-level members LibraryMirror lib = reflectClass(C).owner; - expectSource(lib.declarations[#foo1], - "foo1() {}"); - expectSource(lib.declarations[#x], - "int get x => 42;"); - expectSource(lib.declarations[const Symbol("x=")], - "set x(value) { }"); + expectSource(lib.declarations[#foo1], "foo1() {}"); + expectSource(lib.declarations[#x], "int get x => 42;"); + expectSource(lib.declarations[const Symbol("x=")], "set x(value) { }"); // Class members ClassMirror cm = reflectClass(C); - expectSource(cm.declarations[#foo], + expectSource( + cm.declarations[#foo], "static dynamic foo() {\n" " // Happy foo.\n" " }"); - expectSource(cm.declarations[#bar], - "void bar() { /* Not so happy bar. */ }"); - expectSource(cm.declarations[#someX], + expectSource(cm.declarations[#bar], "void bar() { /* Not so happy bar. */ }"); + expectSource( + cm.declarations[#someX], "num get someX =>\n" " 181;"); - expectSource(cm.declarations[const Symbol("someX=")], + expectSource( + cm.declarations[const Symbol("someX=")], "set someX(v) {\n" " // Discard this one.\n" " }"); - expectSource(cm.declarations[#C], + expectSource( + cm.declarations[#C], "C(this._x, y)\n" " : _y = y,\n" " super();"); - expectSource(cm.declarations[#C.other], - "factory C.other(num z) {}"); - expectSource(cm.declarations[#C.other3], - "factory C.other3() = C.other2;"); + expectSource(cm.declarations[#C.other], "factory C.other(num z) {}"); + expectSource(cm.declarations[#C.other3], "factory C.other3() = C.other2;"); // Closures - expectSource(reflect((){}), "(){}"); - expectSource(reflect((x,y,z) { return x*y*z; }), "(x,y,z) { return x*y*z; }"); + expectSource(reflect(() {}), "(){}"); + expectSource(reflect((x, y, z) { + return x * y * z; + }), "(x,y,z) { return x*y*z; }"); expectSource(reflect((e) => doSomething(e)), "(e) => doSomething(e)"); - namedClosure(x,y,z) => 1; + namedClosure(x, y, z) => 1; var a = () {}; expectSource(reflect(namedClosure), "namedClosure(x,y,z) => 1;"); expectSource(reflect(a), "() {}"); // Function at first line. LibraryMirror otherLib = reflectClass(SomethingInOther).owner; - expectSource(otherLib.declarations[#main], -"""main() { + expectSource( + otherLib.declarations[#main], + """main() { print("Blah"); }"""); }