Version 2.0.0-dev.69.4
Revert cherry-pick 9727a4a to dev
Cherry-pick 6bddb6c to dev
Cherry-pick 57e11e3 to dev
Cherry-pick 0998153 to dev
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index caff028..e82fa74 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -398,7 +398,6 @@
_errorReporter.reportErrorForToken(
CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, node.awaitKeyword);
}
- _checkForUseOfVoidResult(node.expression);
return super.visitAwaitExpression(node);
}
diff --git a/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart b/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart
index f3c148e..92bc27e 100644
--- a/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart
@@ -1636,9 +1636,4 @@
test_useOfVoidResult_variableDeclaration_method_ok() async {
return super.test_useOfVoidResult_variableDeclaration_method_ok();
}
-
- @override
- test_useOfVoidResult_await() async {
- return super.test_useOfVoidResult_await();
- }
}
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index 1417d23..222f88e 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -4489,15 +4489,4 @@
await computeAnalysisResult(source);
assertNoErrors(source);
}
-
- test_useOfVoidResult_await() async {
- Source source = addSource(r'''
-main() async {
- void x;
- await x;
-}''');
- await computeAnalysisResult(source);
- assertErrors(source, [StaticWarningCode.USE_OF_VOID_RESULT]);
- verify([source]);
- }
}
diff --git a/pkg/async_helper/lib/async_helper.dart b/pkg/async_helper/lib/async_helper.dart
index 961d1d6..46360f9 100644
--- a/pkg/async_helper/lib/async_helper.dart
+++ b/pkg/async_helper/lib/async_helper.dart
@@ -23,8 +23,6 @@
library async_helper;
-import 'dart:async';
-
bool _initialized = false;
int _asyncLevel = 0;
@@ -83,7 +81,7 @@
*
* [f] must return a [:Future:] for the test computation.
*/
-Future<void> asyncTest(f()) {
+void asyncTest(f()) {
asyncStart();
- return f().then(asyncSuccess);
+ f().then(asyncSuccess);
}
diff --git a/pkg/dev_compiler/lib/src/compiler/js_names.dart b/pkg/dev_compiler/lib/src/compiler/js_names.dart
index 7de9cf9..8c02846 100644
--- a/pkg/dev_compiler/lib/src/compiler/js_names.dart
+++ b/pkg/dev_compiler/lib/src/compiler/js_names.dart
@@ -15,6 +15,23 @@
/// generation without needing global knowledge. See [TemporaryNamer].
// TODO(jmesserly): move into js_ast? add a boolean to Identifier?
class TemporaryId extends Identifier {
+ // TODO(jmesserly): by design, temporary identifier nodes are shared
+ // throughout the AST, so any source information we attach in one location
+ // be incorrect for another location (and overwrites previous data).
+ //
+ // If we want to track source information for temporary variables, we'll
+ // need to separate the identity of the variable from its Identifier.
+ //
+ // In practice that makes temporaries more difficult to use: they're no longer
+ // JS AST nodes, so `toIdentifier()` is required to put them in the JS AST.
+ // And anywhere we currently use type `Identifier` to hold Identifier or
+ // TemporaryId, those types would need to change to `Identifier Function()`.
+ //
+ // However we may need to fix this if we want hover to work well for things
+ // like library prefixes and field-initializing formals.
+ get sourceInformation => null;
+ set sourceInformation(Object obj) {}
+
TemporaryId(String name) : super(name);
}
diff --git a/pkg/front_end/test/incremental_dart2js_load_from_dill_test.dart b/pkg/front_end/test/incremental_dart2js_load_from_dill_test.dart
index ea0190d..d9a9cad 100644
--- a/pkg/front_end/test/incremental_dart2js_load_from_dill_test.dart
+++ b/pkg/front_end/test/incremental_dart2js_load_from_dill_test.dart
@@ -2,7 +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.
-import 'dart:async' show Future;
import 'dart:io' show Directory, File;
import 'package:expect/expect.dart' show Expect;
@@ -23,7 +22,7 @@
}
}
-Future<void> testDart2jsCompile() async {
+void testDart2jsCompile() async {
final Uri dart2jsUrl = Uri.base.resolve("pkg/compiler/bin/dart2js.dart");
final Uri invalidateUri = Uri.parse("package:compiler/src/filenames.dart");
Uri normalDill = outDir.uri.resolve("dart2js.full.dill");
diff --git a/runtime/observatory/tests/service/async_next_regession_18877_test.dart b/runtime/observatory/tests/service/async_next_regession_18877_test.dart
new file mode 100644
index 0000000..bd74274
--- /dev/null
+++ b/runtime/observatory/tests/service/async_next_regession_18877_test.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2018, 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.
+// VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug
+
+import 'dart:developer';
+import 'service_test_common.dart';
+import 'test_helper.dart';
+
+const int LINE_A = 23;
+const int LINE_B = 24;
+const int LINE_C = 25;
+
+foo() async {}
+
+doAsync(stop) async {
+ // Flutter issue 18877:
+ // If a closure is defined in the context of an async method, stepping over
+ // an await causes the implicit breakpoint to be set for that closure instead
+ // of the async_op, resulting in the debugger falling through.
+ final baz = () => print('doAsync($stop) done!');
+ if (stop) debugger();
+ await foo(); // Line A.
+ await foo(); // Line B.
+ await foo(); // Line C.
+ baz();
+ return null;
+}
+
+testMain() {
+ // With two runs of doAsync floating around, async step should only cause
+ // us to stop in the run we started in.
+ doAsync(false);
+ doAsync(true);
+}
+
+var tests = <IsolateTest>[
+ hasStoppedAtBreakpoint,
+ stoppedAtLine(LINE_A),
+ stepOver, // foo()
+ asyncNext,
+ hasStoppedAtBreakpoint,
+ stoppedAtLine(LINE_B),
+ stepOver, // foo()
+ asyncNext,
+ hasStoppedAtBreakpoint,
+ stoppedAtLine(LINE_C),
+ resumeIsolate,
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
diff --git a/runtime/observatory/tests/service/service_kernel.status b/runtime/observatory/tests/service/service_kernel.status
index b65243f..5f6e399 100644
--- a/runtime/observatory/tests/service/service_kernel.status
+++ b/runtime/observatory/tests/service/service_kernel.status
@@ -5,6 +5,7 @@
[ $compiler == app_jitk ]
add_breakpoint_rpc_test: RuntimeError
async_generator_breakpoint_test: RuntimeError
+async_next_regession_18877_test: RuntimeError
async_next_test: RuntimeError
async_scope_test: RuntimeError
async_single_step_exception_test: RuntimeError
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index bb87152..8db8d44 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -2860,11 +2860,17 @@
TokenPosition token_pos,
TokenPosition last_token_pos,
intptr_t requested_line,
- intptr_t requested_column) {
+ intptr_t requested_column,
+ const Function& function) {
Function& func = Function::Handle();
- if (!FindBestFit(script, token_pos, last_token_pos, &func)) {
- return NULL;
+ if (function.IsNull()) {
+ if (!FindBestFit(script, token_pos, last_token_pos, &func)) {
+ return NULL;
+ }
+ } else {
+ func = function.raw();
}
+
if (!func.IsNull()) {
// There may be more than one function object for a given function
// in source code. There may be implicit closure functions, and
@@ -2971,7 +2977,7 @@
const Script& script = Script::Handle(target_function.script());
BreakpointLocation* bpt_location = SetBreakpoint(
script, target_function.token_pos(), target_function.end_token_pos(), -1,
- -1 /* no requested line/col */);
+ -1 /* no requested line/col */, target_function);
if (bpt_location == NULL) {
return NULL;
}
@@ -2990,8 +2996,9 @@
}
const Function& func = Function::Handle(Closure::Cast(closure).function());
const Script& script = Script::Handle(func.script());
- BreakpointLocation* bpt_location = SetBreakpoint(
- script, func.token_pos(), func.end_token_pos(), -1, -1 /* no line/col */);
+ BreakpointLocation* bpt_location =
+ SetBreakpoint(script, func.token_pos(), func.end_token_pos(), -1,
+ -1 /* no line/col */, func);
return bpt_location->AddPerClosure(this, closure, for_over_await);
}
@@ -3108,7 +3115,7 @@
ASSERT(first_token_idx <= last_token_idx);
while ((bpt == NULL) && (first_token_idx <= last_token_idx)) {
bpt = SetBreakpoint(script, first_token_idx, last_token_idx, line_number,
- column_number);
+ column_number, Function::Handle());
first_token_idx.Next();
}
if ((bpt == NULL) && FLAG_verbose_debug) {
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h
index fedfed1..2128046 100644
--- a/runtime/vm/debugger.h
+++ b/runtime/vm/debugger.h
@@ -664,7 +664,8 @@
TokenPosition token_pos,
TokenPosition last_token_pos,
intptr_t requested_line,
- intptr_t requested_column);
+ intptr_t requested_column,
+ const Function& function);
bool RemoveBreakpointFromTheList(intptr_t bp_id, BreakpointLocation** list);
Breakpoint* GetBreakpointByIdInTheList(intptr_t id, BreakpointLocation* list);
void RemoveUnlinkedCodeBreakpoints();
diff --git a/tests/co19_2/co19_2-analyzer.status b/tests/co19_2/co19_2-analyzer.status
index bbb17dd..d94473f 100644
--- a/tests/co19_2/co19_2-analyzer.status
+++ b/tests/co19_2/co19_2-analyzer.status
@@ -2782,9 +2782,6 @@
LibTest/io/RandomAccessFile/writeString_A01_t03: CompileTimeError # Dart 1 constants, https://github.com/dart-lang/sdk/issues/33894
LibTest/io/Stdin/readLineSync_A03_t01: CompileTimeError # Dart 1 constants, https://github.com/dart-lang/sdk/issues/33894
LibTest/io/Stdin/readLineSync_A03_t02: CompileTimeError # Dart 1 constants, https://github.com/dart-lang/sdk/issues/33894
-LibTest/io/Stdin/readLineSync_A03_t03: CompileTimeError # Erroneously awaits void
-LibTest/io/Stdin/readLineSync_A03_t04: CompileTimeError # Erroneously awaits void
-LibTest/io/Stdin/readLineSync_A04_t01: CompileTimeError # Erroneously awaits void
LibTest/io/Stdout/add_A02_t01: CompileTimeError # Dart 1 constants, https://github.com/dart-lang/sdk/issues/33894
LibTest/io/Stdout/encoding_A01_t01: CompileTimeError # Dart 1 constants, https://github.com/dart-lang/sdk/issues/33894
LibTest/io/Stdout/writeAll_A01_t02: CompileTimeError # Dart 1 constants, https://github.com/dart-lang/sdk/issues/33894
diff --git a/tools/VERSION b/tools/VERSION
index 0ebcd39..7c09085 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -28,5 +28,4 @@
MINOR 0
PATCH 0
PRERELEASE 69
-PRERELEASE_PATCH 3
-*
\ No newline at end of file
+PRERELEASE_PATCH 4
diff --git a/tools/patch_sdk.dart b/tools/patch_sdk.dart
index b4ca60d..e32065c 100644
--- a/tools/patch_sdk.dart
+++ b/tools/patch_sdk.dart
@@ -146,7 +146,7 @@
throw "Unknown mode: $mode";
}
- _writeSync(
+ await _writeSync(
librariesJson.toFilePath(),
jsonEncode({
mode: {"libraries": locations}