Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1167)

Unified Diff: runtime/vm/parser.cc

Issue 2951803005: Set and keep parent function of signature functions. (Closed)
Patch Set: address review comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/runtime_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 836b50d8fdc514d1c23202e1344fb63174f4583a..38774661d77cfa039cede98c3fd78a9bc9acd83b 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -2235,10 +2235,10 @@ void Parser::ParseFormalParameter(bool allow_explicit_default_value,
// signature functions (except typedef signature functions), therefore
// we do not need to keep the correct script via a patch class. Use the
// actual current class as owner of the signature function.
- Function& signature_function =
- Function::Handle(Z, Function::NewSignatureFunction(
- current_class(), TokenPosition::kNoSource));
- signature_function.set_parent_function(innermost_function());
+ Function& signature_function = Function::Handle(
+ Z,
+ Function::NewSignatureFunction(current_class(), innermost_function(),
+ TokenPosition::kNoSource));
innermost_function_ = signature_function.raw();
// Finish parsing the function type parameter.
@@ -5438,8 +5438,8 @@ void Parser::ParseTypedef(const GrowableObjectArray& pending_classes,
Z, ParseFunctionType(result_type, ClassFinalizer::kDoNotResolve));
signature_function = function_type.signature();
} else {
- signature_function =
- Function::NewSignatureFunction(function_type_alias, alias_name_pos);
+ signature_function = Function::NewSignatureFunction(
+ function_type_alias, Function::Handle(Z), alias_name_pos);
innermost_function_ = signature_function.raw();
ParamList params;
// Parse the formal parameters of the function type.
@@ -13311,10 +13311,9 @@ RawType* Parser::ParseFunctionType(
}
do {
ConsumeToken();
- const Function& signature_function =
- Function::Handle(Z, Function::NewSignatureFunction(
- current_class(), TokenPosition::kNoSource));
- signature_function.set_parent_function(innermost_function());
+ const Function& signature_function = Function::Handle(
+ Z, Function::NewSignatureFunction(current_class(), innermost_function(),
+ TokenPosition::kNoSource));
innermost_function_ = signature_function.raw();
signature_function.set_result_type(type);
// Parse optional type parameters.
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/runtime_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698