mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
Revert "Mark async and generator functions as debuggable, so their frames are visible for return type errors during checked mode."
This makes it impossible to set a breakpoint inside a async or generator body. TBR=hausner@google.com Review URL: https://codereview.chromium.org//1025633003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44615 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
406270bf8d
commit
4b1de421ac
3 changed files with 5 additions and 43 deletions
|
@ -3181,24 +3181,23 @@ SequenceNode* Parser::ParseFunc(const Function& func,
|
|||
Function& generated_body_closure = Function::ZoneHandle(Z);
|
||||
if (func.IsAsyncFunction()) {
|
||||
ASSERT(!func.is_generated_body());
|
||||
// Must show frame for checked mode return type error.
|
||||
ASSERT(func.is_debuggable());
|
||||
// The code of an async function is synthesized. Disable debugging.
|
||||
func.set_is_debuggable(false);
|
||||
generated_body_closure = OpenAsyncFunction(func.token_pos());
|
||||
} else if (func.IsAsyncClosure()) {
|
||||
// The closure containing the body of an async function is debuggable.
|
||||
ASSERT(func.is_debuggable());
|
||||
OpenAsyncClosure();
|
||||
} else if (func.IsSyncGenerator()) {
|
||||
// Must show frame for checked mode return type error.
|
||||
ASSERT(func.is_debuggable());
|
||||
// The code of a sync generator is synthesized. Disable debugging.
|
||||
func.set_is_debuggable(false);
|
||||
generated_body_closure = OpenSyncGeneratorFunction(func.token_pos());
|
||||
} else if (func.IsSyncGenClosure()) {
|
||||
// The closure containing the body of a sync generator is debuggable.
|
||||
ASSERT(func.is_debuggable());
|
||||
async_temp_scope_ = current_block_->scope;
|
||||
} else if (func.IsAsyncGenerator()) {
|
||||
// Must show frame for checked mode return type error.
|
||||
ASSERT(func.is_debuggable());
|
||||
func.set_is_debuggable(false);
|
||||
generated_body_closure = OpenAsyncGeneratorFunction(func.token_pos());
|
||||
} else if (func.IsAsyncGenClosure()) {
|
||||
// The closure containing the body of an async* function is debuggable.
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
// Copyright (c) 2015, 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.
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
void badReturnTypeAsync() async {} /// 01: static type warning
|
||||
void badReturnTypeAsyncStar() async* {} /// 02: static type warning
|
||||
void badReturnTypeSyncStar() sync* {} /// 03: static type warning
|
||||
|
||||
main() {
|
||||
try {
|
||||
badReturnTypeAsync(); /// 01: continued
|
||||
} catch(e, st) {
|
||||
Expect.isTrue(e is TypeError, "wrong exception");
|
||||
Expect.isTrue(st.toString().contains("badReturnTypeAsync"),
|
||||
"missing frame");
|
||||
}
|
||||
|
||||
try {
|
||||
badReturnTypeAsyncStar(); /// 02: continued
|
||||
} catch(e, st) {
|
||||
Expect.isTrue(e is TypeError, "wrong exception");
|
||||
Expect.isTrue(st.toString().contains("badReturnTypeAsyncStar"),
|
||||
"missing frame");
|
||||
}
|
||||
|
||||
try {
|
||||
badReturnTypeSyncStar(); /// 03: continued
|
||||
} catch(e, st) {
|
||||
Expect.isTrue(e is TypeError, "wrong exception");
|
||||
Expect.isTrue(st.toString().contains("badReturnTypeSyncStar"),
|
||||
"missing frame");
|
||||
}
|
||||
}
|
|
@ -5,8 +5,6 @@
|
|||
[ $compiler == dartanalyzer ]
|
||||
async_return_types_test/wrongTypeParameter: MissingStaticWarning # Issue 22410
|
||||
async_return_types_test/wrongReturnType: MissingStaticWarning # Issue 22410
|
||||
async_or_generator_return_type_stacktrace_test/01: MissingStaticWarning # Issue 22410
|
||||
async_or_generator_return_type_stacktrace_test/02: MissingStaticWarning # Issue 22410
|
||||
async_return_types_test/nestedFuture: MissingStaticWarning # Issue 22410
|
||||
await_backwards_compatibility_test/none: CompileTimeError # Issue 22052
|
||||
await_test: CompileTimeError # Issue 22052
|
||||
|
|
Loading…
Reference in a new issue