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 #ifndef V8_AST_MODULES_H_ | 5 #ifndef V8_AST_MODULES_H_ |
6 #define V8_AST_MODULES_H_ | 6 #define V8_AST_MODULES_H_ |
7 | 7 |
8 #include "src/parsing/scanner.h" // Only for Scanner::Location. | 8 #include "src/parsing/scanner.h" // Only for Scanner::Location. |
9 #include "src/pending-compilation-error-handler.h" | 9 #include "src/pending-compilation-error-handler.h" |
10 #include "src/zone/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 const ZoneMap<const AstRawString*, const Entry*>& regular_imports() const { | 115 const ZoneMap<const AstRawString*, const Entry*>& regular_imports() const { |
116 return regular_imports_; | 116 return regular_imports_; |
117 } | 117 } |
118 | 118 |
119 // Star exports and explicitly indirect exports. | 119 // Star exports and explicitly indirect exports. |
120 const ZoneList<const Entry*>& special_exports() const { | 120 const ZoneList<const Entry*>& special_exports() const { |
121 return special_exports_; | 121 return special_exports_; |
122 } | 122 } |
123 | 123 |
124 // All the remaining exports, indexed by local name. | 124 // All the remaining exports, indexed by local name. |
| 125 // After canonicalization (see Validate), these are exactly the local exports. |
125 const ZoneMultimap<const AstRawString*, Entry*>& regular_exports() const { | 126 const ZoneMultimap<const AstRawString*, Entry*>& regular_exports() const { |
126 return regular_exports_; | 127 return regular_exports_; |
127 } | 128 } |
128 | 129 |
129 void AddRegularExport(Entry* entry) { | 130 void AddRegularExport(Entry* entry) { |
130 DCHECK_NOT_NULL(entry->export_name); | 131 DCHECK_NOT_NULL(entry->export_name); |
131 DCHECK_NOT_NULL(entry->local_name); | 132 DCHECK_NOT_NULL(entry->local_name); |
132 DCHECK_NULL(entry->import_name); | 133 DCHECK_NULL(entry->import_name); |
133 DCHECK_LT(entry->module_request, 0); | 134 DCHECK_LT(entry->module_request, 0); |
134 regular_exports_.insert(std::make_pair(entry->local_name, entry)); | 135 regular_exports_.insert(std::make_pair(entry->local_name, entry)); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 .insert(std::make_pair(specifier, module_requests_.size())) | 197 .insert(std::make_pair(specifier, module_requests_.size())) |
197 .first; | 198 .first; |
198 return it->second; | 199 return it->second; |
199 } | 200 } |
200 }; | 201 }; |
201 | 202 |
202 } // namespace internal | 203 } // namespace internal |
203 } // namespace v8 | 204 } // namespace v8 |
204 | 205 |
205 #endif // V8_AST_MODULES_H_ | 206 #endif // V8_AST_MODULES_H_ |
OLD | NEW |