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

Unified Diff: runtime/vm/parser.cc

Issue 2951803005: Set and keep parent function of signature functions. (Closed)
Patch Set: 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
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 836b50d8fdc514d1c23202e1344fb63174f4583a..14d1dbb255c69a819151f62627bcc1532d93a706 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(), alias_name_pos);
rmacnak 2017/06/21 20:10:00 Handle(Z)
regis 2017/06/21 20:14:01 Done.
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.

Powered by Google App Engine
This is Rietveld 408576698