Skip to content

Commit 1e60cc1

Browse files
committed
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
2 parents a33be3c + 91324cf commit 1e60cc1

File tree

13 files changed

+90
-37
lines changed

13 files changed

+90
-37
lines changed

pkg/analyzer/lib/src/generated/error_verifier.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
398398
_errorReporter.reportErrorForToken(
399399
CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, node.awaitKeyword);
400400
}
401-
_checkForUseOfVoidResult(node.expression);
402401
return super.visitAwaitExpression(node);
403402
}
404403

pkg/analyzer/test/generated/static_warning_code_kernel_test.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,9 +1636,4 @@ class StaticWarningCodeTest_Kernel extends StaticWarningCodeTest_Driver {
16361636
test_useOfVoidResult_variableDeclaration_method_ok() async {
16371637
return super.test_useOfVoidResult_variableDeclaration_method_ok();
16381638
}
1639-
1640-
@override
1641-
test_useOfVoidResult_await() async {
1642-
return super.test_useOfVoidResult_await();
1643-
}
16441639
}

pkg/analyzer/test/generated/static_warning_code_test.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4489,15 +4489,4 @@ class S {
44894489
await computeAnalysisResult(source);
44904490
assertNoErrors(source);
44914491
}
4492-
4493-
test_useOfVoidResult_await() async {
4494-
Source source = addSource(r'''
4495-
main() async {
4496-
void x;
4497-
await x;
4498-
}''');
4499-
await computeAnalysisResult(source);
4500-
assertErrors(source, [StaticWarningCode.USE_OF_VOID_RESULT]);
4501-
verify([source]);
4502-
}
45034492
}

pkg/async_helper/lib/async_helper.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
2424
library async_helper;
2525

26-
import 'dart:async';
27-
2826
bool _initialized = false;
2927
int _asyncLevel = 0;
3028

@@ -83,7 +81,7 @@ void asyncSuccess(_) => asyncEnd();
8381
*
8482
* [f] must return a [:Future:] for the test computation.
8583
*/
86-
Future<void> asyncTest(f()) {
84+
void asyncTest(f()) {
8785
asyncStart();
88-
return f().then(asyncSuccess);
86+
f().then(asyncSuccess);
8987
}

pkg/dev_compiler/lib/src/compiler/js_names.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ const String dartSdkModule = 'dart_sdk';
1515
/// generation without needing global knowledge. See [TemporaryNamer].
1616
// TODO(jmesserly): move into js_ast? add a boolean to Identifier?
1717
class TemporaryId extends Identifier {
18+
// TODO(jmesserly): by design, temporary identifier nodes are shared
19+
// throughout the AST, so any source information we attach in one location
20+
// be incorrect for another location (and overwrites previous data).
21+
//
22+
// If we want to track source information for temporary variables, we'll
23+
// need to separate the identity of the variable from its Identifier.
24+
//
25+
// In practice that makes temporaries more difficult to use: they're no longer
26+
// JS AST nodes, so `toIdentifier()` is required to put them in the JS AST.
27+
// And anywhere we currently use type `Identifier` to hold Identifier or
28+
// TemporaryId, those types would need to change to `Identifier Function()`.
29+
//
30+
// However we may need to fix this if we want hover to work well for things
31+
// like library prefixes and field-initializing formals.
32+
get sourceInformation => null;
33+
set sourceInformation(Object obj) {}
34+
1835
TemporaryId(String name) : super(name);
1936
}
2037

pkg/front_end/test/incremental_dart2js_load_from_dill_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'dart:async' show Future;
65
import 'dart:io' show Directory, File;
76

87
import 'package:expect/expect.dart' show Expect;
@@ -23,7 +22,7 @@ main() async {
2322
}
2423
}
2524

26-
Future<void> testDart2jsCompile() async {
25+
void testDart2jsCompile() async {
2726
final Uri dart2jsUrl = Uri.base.resolve("pkg/compiler/bin/dart2js.dart");
2827
final Uri invalidateUri = Uri.parse("package:compiler/src/filenames.dart");
2928
Uri normalDill = outDir.uri.resolve("dart2js.full.dill");
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
// VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug
5+
6+
import 'dart:developer';
7+
import 'service_test_common.dart';
8+
import 'test_helper.dart';
9+
10+
const int LINE_A = 23;
11+
const int LINE_B = 24;
12+
const int LINE_C = 25;
13+
14+
foo() async {}
15+
16+
doAsync(stop) async {
17+
// Flutter issue 18877:
18+
// If a closure is defined in the context of an async method, stepping over
19+
// an await causes the implicit breakpoint to be set for that closure instead
20+
// of the async_op, resulting in the debugger falling through.
21+
final baz = () => print('doAsync($stop) done!');
22+
if (stop) debugger();
23+
await foo(); // Line A.
24+
await foo(); // Line B.
25+
await foo(); // Line C.
26+
baz();
27+
return null;
28+
}
29+
30+
testMain() {
31+
// With two runs of doAsync floating around, async step should only cause
32+
// us to stop in the run we started in.
33+
doAsync(false);
34+
doAsync(true);
35+
}
36+
37+
var tests = <IsolateTest>[
38+
hasStoppedAtBreakpoint,
39+
stoppedAtLine(LINE_A),
40+
stepOver, // foo()
41+
asyncNext,
42+
hasStoppedAtBreakpoint,
43+
stoppedAtLine(LINE_B),
44+
stepOver, // foo()
45+
asyncNext,
46+
hasStoppedAtBreakpoint,
47+
stoppedAtLine(LINE_C),
48+
resumeIsolate,
49+
];
50+
51+
main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);

runtime/observatory/tests/service/service_kernel.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[ $compiler == app_jitk ]
66
add_breakpoint_rpc_test: RuntimeError
77
async_generator_breakpoint_test: RuntimeError
8+
async_next_regession_18877_test: RuntimeError
89
async_next_test: RuntimeError
910
async_scope_test: RuntimeError
1011
async_single_step_exception_test: RuntimeError

runtime/vm/debugger.cc

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,11 +2860,17 @@ BreakpointLocation* Debugger::SetBreakpoint(const Script& script,
28602860
TokenPosition token_pos,
28612861
TokenPosition last_token_pos,
28622862
intptr_t requested_line,
2863-
intptr_t requested_column) {
2863+
intptr_t requested_column,
2864+
const Function& function) {
28642865
Function& func = Function::Handle();
2865-
if (!FindBestFit(script, token_pos, last_token_pos, &func)) {
2866-
return NULL;
2866+
if (function.IsNull()) {
2867+
if (!FindBestFit(script, token_pos, last_token_pos, &func)) {
2868+
return NULL;
2869+
}
2870+
} else {
2871+
func = function.raw();
28672872
}
2873+
28682874
if (!func.IsNull()) {
28692875
// There may be more than one function object for a given function
28702876
// in source code. There may be implicit closure functions, and
@@ -2971,7 +2977,7 @@ Breakpoint* Debugger::SetBreakpointAtEntry(const Function& target_function,
29712977
const Script& script = Script::Handle(target_function.script());
29722978
BreakpointLocation* bpt_location = SetBreakpoint(
29732979
script, target_function.token_pos(), target_function.end_token_pos(), -1,
2974-
-1 /* no requested line/col */);
2980+
-1 /* no requested line/col */, target_function);
29752981
if (bpt_location == NULL) {
29762982
return NULL;
29772983
}
@@ -2990,8 +2996,9 @@ Breakpoint* Debugger::SetBreakpointAtActivation(const Instance& closure,
29902996
}
29912997
const Function& func = Function::Handle(Closure::Cast(closure).function());
29922998
const Script& script = Script::Handle(func.script());
2993-
BreakpointLocation* bpt_location = SetBreakpoint(
2994-
script, func.token_pos(), func.end_token_pos(), -1, -1 /* no line/col */);
2999+
BreakpointLocation* bpt_location =
3000+
SetBreakpoint(script, func.token_pos(), func.end_token_pos(), -1,
3001+
-1 /* no line/col */, func);
29953002
return bpt_location->AddPerClosure(this, closure, for_over_await);
29963003
}
29973004

@@ -3108,7 +3115,7 @@ BreakpointLocation* Debugger::BreakpointLocationAtLineCol(
31083115
ASSERT(first_token_idx <= last_token_idx);
31093116
while ((bpt == NULL) && (first_token_idx <= last_token_idx)) {
31103117
bpt = SetBreakpoint(script, first_token_idx, last_token_idx, line_number,
3111-
column_number);
3118+
column_number, Function::Handle());
31123119
first_token_idx.Next();
31133120
}
31143121
if ((bpt == NULL) && FLAG_verbose_debug) {

runtime/vm/debugger.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,8 @@ class Debugger {
664664
TokenPosition token_pos,
665665
TokenPosition last_token_pos,
666666
intptr_t requested_line,
667-
intptr_t requested_column);
667+
intptr_t requested_column,
668+
const Function& function);
668669
bool RemoveBreakpointFromTheList(intptr_t bp_id, BreakpointLocation** list);
669670
Breakpoint* GetBreakpointByIdInTheList(intptr_t id, BreakpointLocation* list);
670671
void RemoveUnlinkedCodeBreakpoints();

0 commit comments

Comments
 (0)