Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: src/scopeinfo.cc

Issue 934323004: Teach ModuleDescriptor about basic local exports (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handled review comments, added message tests Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | test/cctest/cctest.status » ('j') | test/message/export-duplicate.out » ('J')

Powered by Google App Engine
This is Rietveld 408576698