| Index: src/full-codegen.cc
|
| diff --git a/src/full-codegen.cc b/src/full-codegen.cc
|
| index 96395427403438fc7cf58b1510bd80524f2a882d..a37b3e434227a8ebeda60363e040c23166e50e6b 100644
|
| --- a/src/full-codegen.cc
|
| +++ b/src/full-codegen.cc
|
| @@ -55,6 +55,10 @@ void BreakableStatementChecker::VisitVariableDeclaration(
|
| VariableDeclaration* decl) {
|
| }
|
|
|
| +void BreakableStatementChecker::VisitFunctionDeclaration(
|
| + FunctionDeclaration* decl) {
|
| +}
|
| +
|
| void BreakableStatementChecker::VisitModuleDeclaration(
|
| ModuleDeclaration* decl) {
|
| }
|
| @@ -569,29 +573,28 @@ void FullCodeGenerator::VisitDeclarations(
|
| isolate()->factory()->NewFixedArray(2 * global_count_, TENURED);
|
| int length = declarations->length();
|
| for (int j = 0, i = 0; i < length; i++) {
|
| - VariableDeclaration* decl = declarations->at(i)->AsVariableDeclaration();
|
| - if (decl != NULL) {
|
| - Variable* var = decl->proxy()->var();
|
| -
|
| - if (var->IsUnallocated()) {
|
| - array->set(j++, *(var->name()));
|
| - if (decl->fun() == NULL) {
|
| - if (var->binding_needs_init()) {
|
| - // In case this binding needs initialization use the hole.
|
| - array->set_the_hole(j++);
|
| - } else {
|
| - array->set_undefined(j++);
|
| - }
|
| + Declaration* decl = declarations->at(i);
|
| + Variable* var = decl->proxy()->var();
|
| +
|
| + if (var->IsUnallocated()) {
|
| + array->set(j++, *(var->name()));
|
| + FunctionDeclaration* fun_decl = decl->AsFunctionDeclaration();
|
| + if (fun_decl == NULL) {
|
| + if (var->binding_needs_init()) {
|
| + // In case this binding needs initialization use the hole.
|
| + array->set_the_hole(j++);
|
| } else {
|
| - Handle<SharedFunctionInfo> function =
|
| - Compiler::BuildFunctionInfo(decl->fun(), script());
|
| - // Check for stack-overflow exception.
|
| - if (function.is_null()) {
|
| - SetStackOverflow();
|
| - return;
|
| - }
|
| - array->set(j++, *function);
|
| + array->set_undefined(j++);
|
| }
|
| + } else {
|
| + Handle<SharedFunctionInfo> function =
|
| + Compiler::BuildFunctionInfo(fun_decl->fun(), script());
|
| + // Check for stack-overflow exception.
|
| + if (function.is_null()) {
|
| + SetStackOverflow();
|
| + return;
|
| + }
|
| + array->set(j++, *function);
|
| }
|
| }
|
| }
|
| @@ -605,12 +608,17 @@ void FullCodeGenerator::VisitDeclarations(
|
|
|
|
|
| void FullCodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
|
| + EmitDeclaration(decl->proxy(), decl->mode(), NULL);
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
|
| EmitDeclaration(decl->proxy(), decl->mode(), decl->fun());
|
| }
|
|
|
|
|
| void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* decl) {
|
| - // TODO(rossberg)
|
| + EmitDeclaration(decl->proxy(), decl->mode(), NULL);
|
| }
|
|
|
|
|
|
|