OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/typing.h" | 5 #include "src/typing.h" |
6 | 6 |
7 #include "src/frames.h" | 7 #include "src/frames.h" |
8 #include "src/frames-inl.h" | 8 #include "src/frames-inl.h" |
9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
10 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move | 10 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move |
(...skipping 18 matching lines...) Expand all Loading... |
29 do { \ | 29 do { \ |
30 DCHECK(!visitor->HasStackOverflow()); \ | 30 DCHECK(!visitor->HasStackOverflow()); \ |
31 call; \ | 31 call; \ |
32 if (visitor->HasStackOverflow()) return; \ | 32 if (visitor->HasStackOverflow()) return; \ |
33 } while (false) | 33 } while (false) |
34 | 34 |
35 void AstTyper::Run(CompilationInfo* info) { | 35 void AstTyper::Run(CompilationInfo* info) { |
36 AstTyper* visitor = new(info->zone()) AstTyper(info); | 36 AstTyper* visitor = new(info->zone()) AstTyper(info); |
37 Scope* scope = info->scope(); | 37 Scope* scope = info->scope(); |
38 | 38 |
39 // Handle implicit declaration of the function name in named function | |
40 // expressions before other declarations. | |
41 if (scope->is_function_scope() && scope->function() != NULL) { | |
42 RECURSE(visitor->VisitVariableDeclaration(scope->function())); | |
43 } | |
44 RECURSE(visitor->VisitDeclarations(scope->declarations())); | 39 RECURSE(visitor->VisitDeclarations(scope->declarations())); |
45 RECURSE(visitor->VisitStatements(info->function()->body())); | 40 RECURSE(visitor->VisitStatements(info->function()->body())); |
46 } | 41 } |
47 | 42 |
48 #undef RECURSE | 43 #undef RECURSE |
49 | 44 |
50 | 45 |
51 #ifdef OBJECT_PRINT | 46 #ifdef OBJECT_PRINT |
52 static void PrintObserved(Variable* var, Object* value, Type* type) { | 47 static void PrintObserved(Variable* var, Object* value, Type* type) { |
53 OFStream os(stdout); | 48 OFStream os(stdout); |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 void AstTyper::VisitImportDeclaration(ImportDeclaration* declaration) { | 782 void AstTyper::VisitImportDeclaration(ImportDeclaration* declaration) { |
788 } | 783 } |
789 | 784 |
790 | 785 |
791 void AstTyper::VisitExportDeclaration(ExportDeclaration* declaration) { | 786 void AstTyper::VisitExportDeclaration(ExportDeclaration* declaration) { |
792 } | 787 } |
793 | 788 |
794 | 789 |
795 } // namespace internal | 790 } // namespace internal |
796 } // namespace v8 | 791 } // namespace v8 |
OLD | NEW |