OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/scopeinfo.h" | 9 #include "src/scopeinfo.h" |
10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 // ModuleInfo. | 553 // ModuleInfo. |
554 | 554 |
555 Handle<ModuleInfo> ModuleInfo::Create(Isolate* isolate, | 555 Handle<ModuleInfo> ModuleInfo::Create(Isolate* isolate, |
556 ModuleDescriptor* descriptor, | 556 ModuleDescriptor* descriptor, |
557 Scope* scope) { | 557 Scope* scope) { |
558 Handle<ModuleInfo> info = Allocate(isolate, descriptor->Length()); | 558 Handle<ModuleInfo> info = Allocate(isolate, descriptor->Length()); |
559 info->set_host_index(descriptor->Index()); | 559 info->set_host_index(descriptor->Index()); |
560 int i = 0; | 560 int i = 0; |
561 for (ModuleDescriptor::Iterator it = descriptor->iterator(); !it.done(); | 561 for (ModuleDescriptor::Iterator it = descriptor->iterator(); !it.done(); |
562 it.Advance(), ++i) { | 562 it.Advance(), ++i) { |
563 Variable* var = scope->LookupLocal(it.name()); | 563 Variable* var = scope->LookupLocal(it.local_name()); |
564 info->set_name(i, *(it.name()->string())); | 564 info->set_name(i, *(it.export_name()->string())); |
565 info->set_mode(i, var->mode()); | 565 info->set_mode(i, var->mode()); |
566 DCHECK(var->index() >= 0); | 566 DCHECK(var->index() >= 0); |
567 info->set_index(i, var->index()); | 567 info->set_index(i, var->index()); |
568 } | 568 } |
569 DCHECK(i == info->length()); | 569 DCHECK(i == info->length()); |
570 return info; | 570 return info; |
571 } | 571 } |
572 | 572 |
573 } } // namespace v8::internal | 573 } } // namespace v8::internal |
OLD | NEW |