OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/ast/modules.h" | 5 #include "src/ast/modules.h" |
6 #include "src/ast/ast-value-factory.h" | 6 #include "src/ast/ast-value-factory.h" |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Found an indirect export. | 90 // Found an indirect export. |
91 DCHECK_NOT_NULL(it->second->module_request); | 91 DCHECK_NOT_NULL(it->second->module_request); |
92 DCHECK_NOT_NULL(it->second->import_name); | 92 DCHECK_NOT_NULL(it->second->import_name); |
93 entry->import_name = it->second->import_name; | 93 entry->import_name = it->second->import_name; |
94 entry->module_request = it->second->module_request; | 94 entry->module_request = it->second->module_request; |
95 entry->local_name = nullptr; | 95 entry->local_name = nullptr; |
96 } | 96 } |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 bool ModuleDescriptor::Validate(DeclarationScope* module_scope, | 100 bool ModuleDescriptor::Validate(ModuleScope* module_scope, |
101 PendingCompilationErrorHandler* error_handler, | 101 PendingCompilationErrorHandler* error_handler, |
102 Zone* zone) { | 102 Zone* zone) { |
103 DCHECK(module_scope->is_module_scope()); | |
104 DCHECK_EQ(this, module_scope->module()); | 103 DCHECK_EQ(this, module_scope->module()); |
105 DCHECK_NOT_NULL(error_handler); | 104 DCHECK_NOT_NULL(error_handler); |
106 | 105 |
107 // Report error iff there are duplicate exports. | 106 // Report error iff there are duplicate exports. |
108 { | 107 { |
109 ZoneAllocationPolicy allocator(zone); | 108 ZoneAllocationPolicy allocator(zone); |
110 ZoneHashMap* export_names = new (zone->New(sizeof(ZoneHashMap))) | 109 ZoneHashMap* export_names = new (zone->New(sizeof(ZoneHashMap))) |
111 ZoneHashMap(ZoneHashMap::PointersMatch, | 110 ZoneHashMap(ZoneHashMap::PointersMatch, |
112 ZoneHashMap::kDefaultHashMapCapacity, allocator); | 111 ZoneHashMap::kDefaultHashMapCapacity, allocator); |
113 for (auto entry : exports_) { | 112 for (auto entry : exports_) { |
(...skipping 22 matching lines...) Expand all Loading... |
136 return false; | 135 return false; |
137 } | 136 } |
138 } | 137 } |
139 | 138 |
140 MakeIndirectExportsExplicit(); | 139 MakeIndirectExportsExplicit(); |
141 return true; | 140 return true; |
142 } | 141 } |
143 | 142 |
144 } // namespace internal | 143 } // namespace internal |
145 } // namespace v8 | 144 } // namespace v8 |
OLD | NEW |