| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index f37eae5d379156947d316b44ae9da162f558f812..0b9416cf574b9f798935d68b92d520a4cece4714 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -2186,21 +2186,22 @@ Block* Parser::ParseVariableDeclarations(
|
| if (value != NULL && !inside_with()) {
|
| arguments->Add(value, zone());
|
| value = NULL; // zap the value to avoid the unnecessary assignment
|
| + // Construct the call to Runtime_InitializeVarGlobal
|
| + // and add it to the initialization statement block.
|
| + initialize = factory()->NewCallRuntime(
|
| + ast_value_factory_->initialize_var_global_string(),
|
| + Runtime::FunctionForId(Runtime::kInitializeVarGlobal), arguments,
|
| + pos);
|
| + } else {
|
| + initialize = NULL;
|
| }
|
| -
|
| - // Construct the call to Runtime_InitializeVarGlobal
|
| - // and add it to the initialization statement block.
|
| - // Note that the function does different things depending on
|
| - // the number of arguments (2 or 3).
|
| - initialize = factory()->NewCallRuntime(
|
| - ast_value_factory_->initialize_var_global_string(),
|
| - Runtime::FunctionForId(Runtime::kInitializeVarGlobal),
|
| - arguments, pos);
|
| }
|
|
|
| - block->AddStatement(
|
| - factory()->NewExpressionStatement(initialize, RelocInfo::kNoPosition),
|
| - zone());
|
| + if (initialize != NULL) {
|
| + block->AddStatement(factory()->NewExpressionStatement(
|
| + initialize, RelocInfo::kNoPosition),
|
| + zone());
|
| + }
|
| } else if (needs_init) {
|
| // Constant initializations always assign to the declared constant which
|
| // is always at the function scope level. This is only relevant for
|
|
|