| Index: runtime/vm/object.cc
|
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
|
| index c1cec8022088ff8267b686a9239c247baac77a38..0e7eb0dbe9d58394a245a527dea047a5f107bade 100644
|
| --- a/runtime/vm/object.cc
|
| +++ b/runtime/vm/object.cc
|
| @@ -5486,7 +5486,8 @@ bool Function::HasGenericParent() const {
|
| }
|
|
|
| RawFunction* Function::implicit_closure_function() const {
|
| - if (IsClosureFunction() || IsSignatureFunction() || IsFactory()) {
|
| + if (IsClosureFunction() || IsConvertedClosureFunction() ||
|
| + IsSignatureFunction() || IsFactory()) {
|
| return Function::null();
|
| }
|
| const Object& obj = Object::Handle(raw_ptr()->data_);
|
| @@ -5504,7 +5505,8 @@ RawFunction* Function::implicit_closure_function() const {
|
| }
|
|
|
| void Function::set_implicit_closure_function(const Function& value) const {
|
| - ASSERT(!IsClosureFunction() && !IsSignatureFunction());
|
| + ASSERT(!IsClosureFunction() && !IsSignatureFunction() &&
|
| + !IsConvertedClosureFunction());
|
| if (is_native()) {
|
| const Object& obj = Object::Handle(raw_ptr()->data_);
|
| ASSERT(obj.IsArray());
|
| @@ -5625,6 +5627,9 @@ const char* Function::KindToCString(RawFunction::Kind kind) {
|
| case RawFunction::kImplicitClosureFunction:
|
| return "ImplicitClosureFunction";
|
| break;
|
| + case RawFunction::kConvertedClosureFunction:
|
| + return "ConvertedClosureFunction";
|
| + break;
|
| case RawFunction::kSignatureFunction:
|
| return "SignatureFunction";
|
| break;
|
| @@ -6352,7 +6357,7 @@ RawFunction* Function::InstantiateSignatureFrom(
|
| if (IsConvertedClosureFunction()) {
|
| sig = Function::NewConvertedClosureFunction(
|
| String::Handle(zone, name()), parent, TokenPosition::kNoSource);
|
| - // TODO(sjindel): Kernel generic methods undone. Handle type parameters
|
| + // TODO(30455): Kernel generic methods undone. Handle type parameters
|
| // correctly when generic closures are supported. Until then, all type
|
| // parameters to this target are used for captured type variables, so they
|
| // aren't relevant to the type of the function.
|
| @@ -6987,11 +6992,6 @@ RawFunction* Function::ConvertedClosureFunction() const {
|
| // Set closure function's end token to this end token.
|
| closure_function.set_end_token_pos(end_token_pos());
|
|
|
| - // The closurized method stub just calls into the original method and should
|
| - // therefore be skipped by the debugger and in stack traces.
|
| - closure_function.set_is_debuggable(false);
|
| - closure_function.set_is_visible(false);
|
| -
|
| // Set closure function's formal parameters to this formal parameters,
|
| // removing the first parameter over which the currying is done, and adding
|
| // the closure class instance as the first parameter. So, the overall number
|
| @@ -7117,6 +7117,7 @@ void Function::BuildSignatureParameters(
|
| }
|
|
|
| RawInstance* Function::ImplicitStaticClosure() const {
|
| + ASSERT(IsImplicitStaticClosureFunction());
|
| if (implicit_static_closure() == Instance::null()) {
|
| Zone* zone = Thread::Current()->zone();
|
| const Context& context = Object::empty_context();
|
| @@ -7299,7 +7300,7 @@ RawScript* Function::script() const {
|
| return script.raw();
|
| }
|
| }
|
| - if (IsClosureFunction()) {
|
| + if (IsClosureFunction() || IsConvertedClosureFunction()) {
|
| return Function::Handle(parent_function()).script();
|
| }
|
| const Object& obj = Object::Handle(raw_ptr()->owner_);
|
|
|