Version 2.15.0-81.0.dev
Merge commit '01c4999b318e3a6f1475510d577d473377434340' into 'dev'
diff --git a/pkg/analysis_server/test/analysis/notification_navigation_test.dart b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
index be4cdbe..f334a64 100644
--- a/pkg/analysis_server/test/analysis/notification_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
@@ -642,6 +642,92 @@
assertNoRegion('fff);', 3);
}
+ Future<void> test_functionReference_className_staticMethod() async {
+ addTestFile('''
+class A {
+ static void foo<T>() {}
+}
+void f() {
+ A.foo<A>;
+}
+''');
+ await prepareNavigation();
+ assertHasRegionTarget('foo<A>', 'foo<T>');
+ assertHasRegionTarget('A>', 'A {');
+ }
+
+ Future<void> test_functionReference_function() async {
+ addTestFile('''
+class A {}
+void foo<T>() {}
+void f() {
+ foo<A>;
+}
+''');
+ await prepareNavigation();
+ assertHasRegionTarget('foo<A>', 'foo<T>');
+ assertHasRegionTarget('A>', 'A {');
+ }
+
+ Future<void> test_functionReference_importPrefix_function() async {
+ newFile(join(testFolder, 'a.dart'), content: r'''
+void foo<T>() {}
+''');
+ addTestFile('''
+import 'a.dart' as prefix;
+class A {}
+void f() {
+ prefix.foo<A>;
+}
+''');
+ await prepareNavigation();
+ assertHasRegionTarget('prefix.', 'prefix;');
+ assertHasRegion('foo<A>');
+ assertHasRegionTarget('A>', 'A {');
+ }
+
+ Future<void> test_functionReference_instance_method() async {
+ addTestFile('''
+class A {
+ void foo<T>() {}
+}
+void f(A a) {
+ a.foo<A>;
+}
+''');
+ await prepareNavigation();
+ assertHasRegionTarget('foo<A>', 'foo<T>');
+ assertHasRegionTarget('A>', 'A {');
+ }
+
+ Future<void> test_functionReference_method() async {
+ addTestFile('''
+class A {
+ void foo<T>() {}
+ void f() {
+ foo<A>;
+ }
+}
+''');
+ await prepareNavigation();
+ assertHasRegionTarget('foo<A>', 'foo<T>');
+ assertHasRegionTarget('A>', 'A {');
+ }
+
+ Future<void> test_functionReference_staticMethod() async {
+ addTestFile('''
+class A {
+ static void foo<T>() {}
+ void f() {
+ foo<A>;
+ }
+}
+''');
+ await prepareNavigation();
+ assertHasRegionTarget('foo<A>', 'foo<T>');
+ assertHasRegionTarget('A>', 'A {');
+ }
+
Future<void> test_identifier_resolved() async {
addTestFile('''
class AAA {}
diff --git a/pkg/analyzer/lib/src/dart/analysis/index.dart b/pkg/analyzer/lib/src/dart/analysis/index.dart
index 140a1a7..1d20779 100644
--- a/pkg/analyzer/lib/src/dart/analysis/index.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/index.dart
@@ -741,7 +741,7 @@
recordRelationOffset(
element, IndexRelationKind.IS_REFERENCED_BY, offset, 0, true);
}
- super.visitRedirectingConstructorInvocation(node);
+ node.argumentList.accept(this);
}
@override
diff --git a/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart b/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart
index 4066201..caf21ee 100644
--- a/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart
@@ -227,6 +227,9 @@
// This isn't a constructor reference.
return node;
}
+ if (node.parent is AssignmentExpression) {
+ return node;
+ }
var prefix = node.prefix;
var element = nameScope.lookup(prefix.name).getter;
if (element is ClassElement) {
diff --git a/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart
index 2344d90..1f2aaf5 100644
--- a/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart
@@ -72,6 +72,12 @@
receiverType = _resolveTypeParameter(receiverType, ifLegacy: true);
+ if (name == 'new') {
+ _needsGetterError = true;
+ _needsSetterError = true;
+ return _toResult();
+ }
+
if (_typeSystem.isDynamicBounded(receiverType)) {
_lookupInterfaceType(
_typeProvider.objectType,
diff --git a/pkg/analyzer/test/src/dart/analysis/index_test.dart b/pkg/analyzer/test/src/dart/analysis/index_test.dart
index c61fa44..b6d1f58 100644
--- a/pkg/analyzer/test/src/dart/analysis/index_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/index_test.dart
@@ -659,43 +659,6 @@
// No exception, even though a.dart is a part of b.dart part.
}
- test_isReferencedBy_ConstructorElement() async {
- await _indexTestUnit('''
-/// [new A.foo] 1
-/// [A.foo] 2
-/// [new A] 3
-class A implements B {
- A() {}
- A.foo() {}
-}
-class B extends A {
- B() : super(); // 4
- B.foo() : super.foo(); // 5
- factory B.bar() = A.foo; // 6
-}
-main() {
- new A(); // 7
- new A.foo(); // 8
-}
-''');
- var constA = findElement.unnamedConstructor('A');
- var constA_foo = findElement.constructor('foo', of: 'A');
- // A()
- assertThat(constA)
- ..hasRelationCount(3)
- ..isReferencedAt('] 3', true, length: 0)
- ..isReferencedAt('(); // 4', true, length: 0)
- ..isReferencedAt('(); // 7', true, length: 0);
- // A.foo()
- assertThat(constA_foo)
- ..hasRelationCount(5)
- ..isReferencedAt('.foo] 1', true, length: 4)
- ..isReferencedAt('.foo] 2', true, length: 4)
- ..isReferencedAt('.foo(); // 5', true, length: 4)
- ..isReferencedAt('.foo; // 6', true, length: 4)
- ..isReferencedAt('.foo(); // 8', true, length: 4);
- }
-
test_isReferencedBy_ConstructorElement_classTypeAlias() async {
await _indexTestUnit('''
class M {}
@@ -735,6 +698,33 @@
// No additional validation, but it should not fail with stack overflow.
}
+ test_isReferencedBy_ConstructorElement_named() async {
+ await _indexTestUnit('''
+/// [new A.foo] 1
+class A {
+ A.foo() {}
+ A.bar() : this.foo(); // 2
+}
+class B extends A {
+ B() : super.foo(); // 3
+ factory B.bar() = A.foo; // 4
+}
+void f() {
+ A.foo(); // 5
+ A.foo; // 6
+}
+''');
+ var element = findElement.constructor('foo');
+ assertThat(element)
+ ..hasRelationCount(6)
+ ..isReferencedAt('.foo] 1', true, length: 4)
+ ..isReferencedAt('.foo(); // 2', true, length: 4)
+ ..isReferencedAt('.foo(); // 3', true, length: 4)
+ ..isReferencedAt('.foo; // 4', true, length: 4)
+ ..isReferencedAt('.foo(); // 5', true, length: 4)
+ ..isReferencedAt('.foo; // 6', true, length: 4);
+ }
+
test_isReferencedBy_ConstructorElement_namedOnlyWithDot() async {
await _indexTestUnit('''
class A {
@@ -766,16 +756,77 @@
assertThat(constA_bar).isReferencedAt('.bar(); // 1', true, length: 4);
}
- test_isReferencedBy_ConstructorElement_synthetic() async {
+ test_isReferencedBy_ConstructorElement_unnamed_declared() async {
await _indexTestUnit('''
-class A {}
-main() {
- new A(); // 1
+/// [new A] 1
+class A {
+ A() {}
+}
+class B extends A {
+ B() : super(); // 2
+ factory B.bar() = A; // 3
+}
+void f() {
+ A(); // 4
+ A.new; // 5
}
''');
- var constA = findElement.unnamedConstructor('A');
- // A()
- assertThat(constA)..isReferencedAt('(); // 1', true, length: 0);
+ var element = findElement.unnamedConstructor('A');
+ assertThat(element)
+ ..hasRelationCount(5)
+ ..isReferencedAt('] 1', true, length: 0)
+ ..isReferencedAt('(); // 2', true, length: 0)
+ ..isReferencedAt('; // 3', true, length: 0)
+ ..isReferencedAt('(); // 4', true, length: 0)
+ ..isReferencedAt('.new; // 5', true, length: 4);
+ }
+
+ test_isReferencedBy_ConstructorElement_unnamed_declared_new() async {
+ await _indexTestUnit('''
+/// [new A] 1
+class A {
+ A.new() {}
+}
+class B extends A {
+ B() : super(); // 2
+ factory B.bar() = A; // 3
+}
+void f() {
+ A(); // 4
+ A.new; // 5
+}
+''');
+ var element = findElement.unnamedConstructor('A');
+ assertThat(element)
+ ..hasRelationCount(5)
+ ..isReferencedAt('] 1', true, length: 0)
+ ..isReferencedAt('(); // 2', true, length: 0)
+ ..isReferencedAt('; // 3', true, length: 0)
+ ..isReferencedAt('(); // 4', true, length: 0)
+ ..isReferencedAt('.new; // 5', true, length: 4);
+ }
+
+ test_isReferencedBy_ConstructorElement_unnamed_synthetic() async {
+ await _indexTestUnit('''
+/// [new A] 1
+class A {}
+class B extends A {
+ B() : super(); // 2
+ factory B.bar() = A; // 3
+}
+void f() {
+ A(); // 4
+ A.new; // 5
+}
+''');
+ var element = findElement.unnamedConstructor('A');
+ assertThat(element)
+ ..hasRelationCount(5)
+ ..isReferencedAt('] 1', true, length: 0)
+ ..isReferencedAt('(); // 2', true, length: 0)
+ ..isReferencedAt('; // 3', true, length: 0)
+ ..isReferencedAt('(); // 4', true, length: 0)
+ ..isReferencedAt('.new; // 5', true, length: 4);
}
test_isReferencedBy_DynamicElement() async {
diff --git a/pkg/analyzer/test/src/dart/analysis/search_test.dart b/pkg/analyzer/test/src/dart/analysis/search_test.dart
index dab758b..774cbf2 100644
--- a/pkg/analyzer/test/src/dart/analysis/search_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/search_test.dart
@@ -342,29 +342,80 @@
await _verifyReferences(element, expected);
}
- test_searchReferences_ConstructorElement_default() async {
+ test_searchReferences_ConstructorElement_named() async {
+ await resolveTestCode('''
+class A {
+ A.named() {}
+}
+
+void main() {
+ A.named();
+ A.named;
+}
+''');
+ var element = findElement.constructor('named');
+ var main = findElement.function('main');
+ var expected = [
+ _expectIdQ(main, SearchResultKind.REFERENCE, '.named();',
+ length: '.named'.length),
+ _expectIdQ(main, SearchResultKind.REFERENCE, '.named;',
+ length: '.named'.length),
+ ];
+ await _verifyReferences(element, expected);
+ }
+
+ test_searchReferences_ConstructorElement_named_viaTypeAlias() async {
+ await resolveTestCode('''
+class A<T> {
+ A.named();
+}
+
+typedef B = A<int>;
+
+void f() {
+ B.named(); // ref
+ B.named;
+}
+''');
+
+ var element = findElement.constructor('named');
+ var f = findElement.topFunction('f');
+ await _verifyReferences(element, [
+ _expectIdQ(f, SearchResultKind.REFERENCE, '.named(); // ref',
+ length: '.named'.length),
+ _expectIdQ(f, SearchResultKind.REFERENCE, '.named;',
+ length: '.named'.length),
+ ]);
+ }
+
+ test_searchReferences_ConstructorElement_unnamed() async {
await resolveTestCode('''
class A {
A() {}
}
-main() {
- new A();
+
+void main() {
+ A();
+ A.new;
}
''');
var element = findElement.unnamedConstructor('A');
var main = findElement.function('main');
var expected = [
- _expectIdQ(main, SearchResultKind.REFERENCE, '();', length: 0)
+ _expectIdQ(main, SearchResultKind.REFERENCE, '();', length: 0),
+ _expectIdQ(main, SearchResultKind.REFERENCE, '.new;',
+ length: '.new'.length),
];
await _verifyReferences(element, expected);
}
- test_searchReferences_ConstructorElement_default_otherFile() async {
+ test_searchReferences_ConstructorElement_unnamed_otherFile() async {
String other = convertPath('$testPackageLibPath/other.dart');
String otherCode = '''
import 'test.dart';
-main() {
- new A(); // in other
+
+void f() {
+ A(); // in other
}
''';
newFile(other, content: otherCode);
@@ -388,57 +439,21 @@
await _verifyReferences(element, expected);
}
- test_searchReferences_ConstructorElement_named() async {
+ test_searchReferences_ConstructorElement_unnamed_synthetic() async {
await resolveTestCode('''
-class A {
- A.named() {}
-}
-main() {
- new A.named();
-}
-''');
- var element = findElement.constructor('named');
- var main = findElement.function('main');
- var expected = [
- _expectIdQ(main, SearchResultKind.REFERENCE, '.named();',
- length: '.named'.length)
- ];
- await _verifyReferences(element, expected);
- }
+class A {}
- test_searchReferences_ConstructorElement_named_viaTypeAlias() async {
- await resolveTestCode('''
-class A<T> {
- A.named();
-}
-
-typedef B = A<int>;
-
-void f() {
- B.named(); // ref
-}
-''');
-
- var element = findElement.constructor('named');
- var f = findElement.topFunction('f');
- await _verifyReferences(element, [
- _expectIdQ(f, SearchResultKind.REFERENCE, '.named(); // ref',
- length: '.named'.length),
- ]);
- }
-
- test_searchReferences_ConstructorElement_synthetic() async {
- await resolveTestCode('''
-class A {
-}
-main() {
- new A();
+void main() {
+ A();
+ A.new;
}
''');
var element = findElement.unnamedConstructor('A');
var main = findElement.function('main');
var expected = [
- _expectIdQ(main, SearchResultKind.REFERENCE, '();', length: 0)
+ _expectIdQ(main, SearchResultKind.REFERENCE, '();', length: 0),
+ _expectIdQ(main, SearchResultKind.REFERENCE, '.new;',
+ length: '.new'.length),
];
await _verifyReferences(element, expected);
}
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart
index 193e74a..cb85d4f 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart
@@ -441,4 +441,88 @@
int f() => A.x;
''');
}
+
+ test_new_cascade() async {
+ await assertErrorsInCode('''
+class C {}
+
+f(C? c) {
+ c..new;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_GETTER, 27, 3),
+ ]);
+ }
+
+ test_new_dynamic() async {
+ await assertErrorsInCode('''
+f(dynamic d) {
+ d.new;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_GETTER, 19, 3),
+ ]);
+ }
+
+ test_new_expression() async {
+ await assertErrorsInCode('''
+class C {}
+
+f(C? c1, C c2) {
+ (c1 ?? c2).new;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_GETTER, 42, 3),
+ ]);
+ }
+
+ test_new_nullAware() async {
+ await assertErrorsInCode('''
+class C {}
+
+f(C? c) {
+ c?.new;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_GETTER, 27, 3),
+ ]);
+ }
+
+ test_new_prefixedIdentifier() async {
+ await assertErrorsInCode('''
+class C {}
+
+abstract class D {
+ C get c;
+}
+
+f(D d) {
+ d.c.new;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_GETTER, 60, 3),
+ ]);
+ }
+
+ test_new_simpleIdentifier() async {
+ await assertErrorsInCode('''
+class C {}
+
+f(C c) {
+ c.new;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_GETTER, 25, 3),
+ ]);
+ }
+
+ test_new_typeVariable() async {
+ await assertErrorsInCode('''
+f<T>(T t) {
+ t.new;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_GETTER, 16, 3),
+ ]);
+ }
}
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart
index 87cafbf..e9c6092 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart
@@ -25,6 +25,18 @@
]);
}
+ test_new() async {
+ newFile('$testPackageLibPath/lib.dart', content: '');
+ await assertErrorsInCode(r'''
+import 'lib.dart' as p;
+void f() {
+ p.new;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 39, 3),
+ ]);
+ }
+
test_setterContext() async {
newFile('$testPackageLibPath/lib.dart');
await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart
index 65ba939..d1674c6 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart
@@ -143,6 +143,74 @@
@reflectiveTest
class UndefinedSetterWithNullSafetyTest extends PubPackageResolutionTest
with UndefinedSetterTestCases {
+ test_new_cascade() async {
+ await assertErrorsInCode('''
+class C {}
+
+f(C? c) {
+ c..new = 1;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_SETTER, 27, 3),
+ ]);
+ }
+
+ test_new_dynamic() async {
+ await assertErrorsInCode('''
+f(dynamic d) {
+ d.new = 1;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_SETTER, 19, 3),
+ ]);
+ }
+
+ test_new_instance() async {
+ await assertErrorsInCode('''
+class C {}
+
+f(C c) {
+ c.new = 1;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_SETTER, 25, 3),
+ ]);
+ }
+
+ test_new_interfaceType() async {
+ await assertErrorsInCode('''
+class C {}
+
+f() {
+ C.new = 1;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_SETTER, 22, 3),
+ ]);
+ }
+
+ test_new_nullAware() async {
+ await assertErrorsInCode('''
+class C {}
+
+f(C? c) {
+ c?.new = 1;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_SETTER, 27, 3),
+ ]);
+ }
+
+ test_new_typeVariable() async {
+ await assertErrorsInCode('''
+f<T>(T t) {
+ t.new = 1;
+}
+''', [
+ error(CompileTimeErrorCode.UNDEFINED_SETTER, 16, 3),
+ ]);
+ }
+
test_set_abstract_field_valid() async {
await assertNoErrorsInCode('''
abstract class A {
diff --git a/runtime/tests/vm/dart/isolates/dart_api_create_lightweight_isolate_test.dart b/runtime/tests/vm/dart/isolates/dart_api_create_lightweight_isolate_test.dart
index 2fa4962..f4005be 100644
--- a/runtime/tests/vm/dart/isolates/dart_api_create_lightweight_isolate_test.dart
+++ b/runtime/tests/vm/dart/isolates/dart_api_create_lightweight_isolate_test.dart
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
// SharedObjects=ffi_test_functions
-// VMOptions=
+// VMOptions=--no-enable-isolate-groups
// VMOptions=--enable-isolate-groups --disable-heap-verification
import 'dart:async';
diff --git a/runtime/tests/vm/dart_2/isolates/dart_api_create_lightweight_isolate_test.dart b/runtime/tests/vm/dart_2/isolates/dart_api_create_lightweight_isolate_test.dart
index c14ce31..0a2fd1c 100644
--- a/runtime/tests/vm/dart_2/isolates/dart_api_create_lightweight_isolate_test.dart
+++ b/runtime/tests/vm/dart_2/isolates/dart_api_create_lightweight_isolate_test.dart
@@ -5,7 +5,7 @@
// @dart = 2.9
// SharedObjects=ffi_test_functions
-// VMOptions=
+// VMOptions=--no-enable-isolate-groups
// VMOptions=--enable-isolate-groups --disable-heap-verification
import 'dart:async';
diff --git a/runtime/vm/flag_list.h b/runtime/vm/flag_list.h
index 1e3544d..b5f86e7 100644
--- a/runtime/vm/flag_list.h
+++ b/runtime/vm/flag_list.h
@@ -196,8 +196,7 @@
P(retain_code_objects, bool, true, \
"Serialize all code objects even if not otherwise " \
"needed in the precompiled runtime.") \
- P(enable_isolate_groups, bool, false, \
- "Enable isolate group support in AOT.") \
+ P(enable_isolate_groups, bool, true, "Enable isolate group support.") \
P(show_invisible_frames, bool, false, \
"Show invisible frames in stack traces.") \
D(trace_cha, bool, false, "Trace CHA operations") \
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 50660b9..e11e430 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -33,6 +33,7 @@
import 'dart:web_gl' show RenderingContext, RenderingContext2;
import 'dart:web_sql';
import 'dart:_foreign_helper' show JS, JS_INTERCEPTOR_CONSTANT;
+import 'dart:js_util' as js_util;
// Copyright (c) 2012, 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.
diff --git a/tests/lib/isolate/static_function_test.dart b/tests/lib/isolate/static_function_test.dart
index e1ece06..0708dc3 100644
--- a/tests/lib/isolate/static_function_test.dart
+++ b/tests/lib/isolate/static_function_test.dart
@@ -9,6 +9,7 @@
library static_function_test;
+import 'dart:io';
import 'dart:isolate';
import 'static_function_lib.dart' as lib;
import 'package:async_helper/async_helper.dart';
@@ -115,6 +116,9 @@
}
void main([args, port]) {
+ final bool isolateGroupsEnabled =
+ Platform.executableArguments.contains('--enable-isolate-groups');
+
asyncStart();
// Sanity check.
spawnTest("function", function, "TOP");
@@ -134,16 +138,31 @@
spawnTest("lib._class._function", lib.privateClassFunction, "_LIB");
spawnTest("lib._class._function", lib.privateClassAndFunction, "_LIBPRIVATE");
- // Negative tests
- functionFailTest("static closure", staticClosure);
- functionFailTest("dynamic closure", dynamicClosure);
- functionFailTest("named dynamic closure", namedDynamicClosure);
- functionFailTest("instance closure", new C().instanceClosure);
- functionFailTest(
- "initializer closure", new C().constructorInitializerClosure);
- functionFailTest("constructor closure", new C().constructorBodyClosure);
- functionFailTest(
- "named constructor closure", new C().namedConstructorBodyClosure);
- functionFailTest("instance method", new C().instanceMethod);
+ if (isolateGroupsEnabled) {
+ spawnTest("static closure", staticClosure, "WHAT?");
+ spawnTest("dynamic closure", dynamicClosure, "WHAT??");
+ spawnTest("named dynamic closure", namedDynamicClosure, "WHAT FOO??");
+ spawnTest("instance closure", new C().instanceClosure, "C WHAT?");
+ spawnTest(
+ "initializer closure", new C().constructorInitializerClosure, "Init?");
+ spawnTest(
+ "constructor closure", new C().constructorBodyClosure, "bodyClosure?");
+ spawnTest("named constructor closure", new C().namedConstructorBodyClosure,
+ "namedBodyClosure?");
+ spawnTest("instance method", new C().instanceMethod, "INSTANCE WHAT?");
+ } else {
+ // Negative tests
+ functionFailTest("static closure", staticClosure);
+ functionFailTest("dynamic closure", dynamicClosure);
+ functionFailTest("named dynamic closure", namedDynamicClosure);
+ functionFailTest("instance closure", new C().instanceClosure);
+ functionFailTest(
+ "initializer closure", new C().constructorInitializerClosure);
+ functionFailTest("constructor closure", new C().constructorBodyClosure);
+ functionFailTest(
+ "named constructor closure", new C().namedConstructorBodyClosure);
+ functionFailTest("instance method", new C().instanceMethod);
+ }
+
asyncEnd();
}
diff --git a/tests/lib_2/isolate/static_function_test.dart b/tests/lib_2/isolate/static_function_test.dart
index 17f18e5..23a18fe 100644
--- a/tests/lib_2/isolate/static_function_test.dart
+++ b/tests/lib_2/isolate/static_function_test.dart
@@ -11,6 +11,7 @@
library static_function_test;
+import 'dart:io';
import 'dart:isolate';
import 'static_function_lib.dart' as lib;
import 'package:async_helper/async_helper.dart';
@@ -117,6 +118,9 @@
}
void main([args, port]) {
+ final bool isolateGroupsEnabled =
+ Platform.executableArguments.contains('--enable-isolate-groups');
+
asyncStart();
// Sanity check.
spawnTest("function", function, "TOP");
@@ -136,16 +140,31 @@
spawnTest("lib._class._function", lib.privateClassFunction, "_LIB");
spawnTest("lib._class._function", lib.privateClassAndFunction, "_LIBPRIVATE");
- // Negative tests
- functionFailTest("static closure", staticClosure);
- functionFailTest("dynamic closure", dynamicClosure);
- functionFailTest("named dynamic closure", namedDynamicClosure);
- functionFailTest("instance closure", new C().instanceClosure);
- functionFailTest(
- "initializer closure", new C().constructorInitializerClosure);
- functionFailTest("constructor closure", new C().constructorBodyClosure);
- functionFailTest(
- "named constructor closure", new C().namedConstructorBodyClosure);
- functionFailTest("instance method", new C().instanceMethod);
+ if (isolateGroupsEnabled) {
+ spawnTest("static closure", staticClosure, "WHAT?");
+ spawnTest("dynamic closure", dynamicClosure, "WHAT??");
+ spawnTest("named dynamic closure", namedDynamicClosure, "WHAT FOO??");
+ spawnTest("instance closure", new C().instanceClosure, "C WHAT?");
+ spawnTest(
+ "initializer closure", new C().constructorInitializerClosure, "Init?");
+ spawnTest(
+ "constructor closure", new C().constructorBodyClosure, "bodyClosure?");
+ spawnTest("named constructor closure", new C().namedConstructorBodyClosure,
+ "namedBodyClosure?");
+ spawnTest("instance method", new C().instanceMethod, "INSTANCE WHAT?");
+ } else {
+ // Negative tests
+ functionFailTest("static closure", staticClosure);
+ functionFailTest("dynamic closure", dynamicClosure);
+ functionFailTest("named dynamic closure", namedDynamicClosure);
+ functionFailTest("instance closure", new C().instanceClosure);
+ functionFailTest(
+ "initializer closure", new C().constructorInitializerClosure);
+ functionFailTest("constructor closure", new C().constructorBodyClosure);
+ functionFailTest(
+ "named constructor closure", new C().namedConstructorBodyClosure);
+ functionFailTest("instance method", new C().instanceMethod);
+ }
+
asyncEnd();
}
diff --git a/tools/VERSION b/tools/VERSION
index 4a2ce87..5394c86 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 15
PATCH 0
-PRERELEASE 80
+PRERELEASE 81
PRERELEASE_PATCH 0
\ No newline at end of file