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

Unified Diff: runtime/vm/parser.cc

Issue 1947683002: Remove small window when function parameter types and names were reset to null (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | 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 80c6021f622e178a22ea9446e9fca67e761272ab..51e97146efac7253f0f313ae7702dc43beb87e81 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -3297,7 +3297,9 @@ SequenceNode* Parser::ParseFunc(const Function& func, bool check_semicolon) {
// The number of parameters and their type are not yet set in local
// functions, since they are not 'top-level' parsed.
- if (func.IsLocalFunction()) {
+ // However, they are already set when the local function is compiled, since
+ // the local function was parsed when its parent was compiled.
+ if (func.parameter_types() == Object::empty_array().raw()) {
AddFormalParamsToFunction(&params, func);
}
SetupDefaultsForOptionalParams(params);
@@ -7287,6 +7289,8 @@ void Parser::AddFormalParamsToFunction(const ParamList* params,
params->has_optional_positional_parameters);
const int num_parameters = params->parameters->length();
ASSERT(num_parameters == func.NumParameters());
+ ASSERT(func.parameter_types() == Object::empty_array().raw());
+ ASSERT(func.parameter_names() == Object::empty_array().raw());
func.set_parameter_types(Array::Handle(Array::New(num_parameters,
Heap::kOld)));
func.set_parameter_names(Array::Handle(Array::New(num_parameters,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698