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

Unified Diff: src/contexts.cc

Issue 2302013002: Store the scope info in catch contexts (Closed)
Patch Set: updates 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/compiler/js-operator.cc ('k') | src/factory.h » ('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 ea4730042fc468ed0623b9a0198a6e095411895c..3c9e471479453a0c0e11a2e92d0e1b9f70e87898 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -110,10 +110,11 @@ JSReceiver* Context::extension_receiver() {
ScopeInfo* Context::scope_info() {
- DCHECK(IsModuleContext() || IsScriptContext() || IsBlockContext());
+ DCHECK(IsModuleContext() || IsScriptContext() || IsBlockContext() ||
+ IsCatchContext());
HeapObject* object = extension();
if (object->IsContextExtension()) {
- DCHECK(IsBlockContext());
+ DCHECK(IsBlockContext() || IsCatchContext());
object = ContextExtension::cast(object)->scope_info();
}
return ScopeInfo::cast(object);
@@ -122,7 +123,7 @@ ScopeInfo* Context::scope_info() {
String* Context::catch_name() {
DCHECK(IsCatchContext());
- return String::cast(extension());
+ return String::cast(ContextExtension::cast(extension())->extension());
}
« no previous file with comments | « src/compiler/js-operator.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698