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

Unified Diff: src/contexts.cc

Issue 2302783002: [modules] Basic support of exports (Closed)
Patch Set: Disable module tests for deopt fuzzer. 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 | « src/contexts.h ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index d4910eac03d6bf38a607d7c5f992b5907fc52a0e..a08fd04dbb7002c0280ed94a47765a8d82ee5604 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -57,7 +57,8 @@ bool ScriptContextTable::Lookup(Handle<ScriptContextTable> table,
bool Context::is_declaration_context() {
- if (IsFunctionContext() || IsNativeContext() || IsScriptContext()) {
+ if (IsFunctionContext() || IsNativeContext() || IsScriptContext() ||
+ IsModuleContext()) {
return true;
}
if (!IsBlockContext()) return false;
@@ -123,6 +124,13 @@ ScopeInfo* Context::scope_info() {
return ScopeInfo::cast(object);
}
+JSModule* Context::module() {
+ Context* current = this;
+ while (!current->IsModuleContext()) {
+ current = current->previous();
+ }
+ return JSModule::cast(current->extension());
+}
String* Context::catch_name() {
DCHECK(IsCatchContext());
@@ -189,6 +197,7 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags,
int* index, PropertyAttributes* attributes,
InitializationFlag* init_flag,
VariableMode* variable_mode) {
+ DCHECK(!IsModuleContext());
Isolate* isolate = GetIsolate();
Handle<Context> context(this, isolate);
« no previous file with comments | « src/contexts.h ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698