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

Unified Diff: src/factory.cc

Issue 2367623004: [modules] Detect and throw exceptions for cyclic dependencies (Closed)
Patch Set: Handled review comments, added a test Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 3c0c7578760f4a0adb226d0ed5221c8e7231f9cd..087aad36936c0c2f4eb8ce9e2a1f3eb37dd5bd61 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1759,6 +1759,11 @@ Handle<Module> Factory::NewModule(Handle<SharedFunctionInfo> code) {
requested_modules_length > 0 ? NewFixedArray(requested_modules_length)
: empty_fixed_array();
+ // To make it easy to hash Modules, we set a new symbol as the name of
+ // SharedFunctionInfo representing this Module.
+ Handle<Symbol> name_symbol = NewSymbol();
+ code->set_name(*name_symbol);
+
Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE));
module->set_code(*code);
module->set_exports(*exports);
« no previous file with comments | « no previous file | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698