Index: src/debug/debug-scopes.cc |
diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc |
index 68abfd3a98e903406275d70c8c7c7cf51b6f885a..e6224b33045b5edf6cb4dc4ba7de30e2eceddc87 100644 |
--- a/src/debug/debug-scopes.cc |
+++ b/src/debug/debug-scopes.cc |
@@ -22,8 +22,7 @@ ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector, |
nested_scope_chain_(4), |
seen_script_scope_(false), |
failed_(false) { |
- if (!frame_inspector->GetContext()->IsContext() || |
- !frame_inspector->GetFunction()->IsJSFunction()) { |
+ if (!frame_inspector->GetContext()->IsContext()) { |
// Optimized frame, context or function cannot be materialized. Give up. |
return; |
} |
@@ -614,11 +613,11 @@ bool ScopeIterator::SetParameterValue(Handle<ScopeInfo> scope_info, |
} |
bool ScopeIterator::SetStackVariableValue(Handle<ScopeInfo> scope_info, |
- JavaScriptFrame* frame, |
Handle<String> variable_name, |
Handle<Object> new_value) { |
- // Setting stack locals of optimized frames is not supported. |
- if (frame->is_optimized()) return false; |
+ StandardFrame* frame = GetFrame(); |
+ // Setting stack locals of optimized frames and wasm frames is not supported. |
+ if (frame->is_optimized() || frame->is_wasm()) return false; |
HandleScope scope(isolate_); |
for (int i = 0; i < scope_info->StackLocalCount(); ++i) { |
if (String::Equals(handle(scope_info->StackLocalName(i)), variable_name)) { |
@@ -665,14 +664,18 @@ bool ScopeIterator::SetContextVariableValue(Handle<ScopeInfo> scope_info, |
bool ScopeIterator::SetLocalVariableValue(Handle<String> variable_name, |
Handle<Object> new_value) { |
- JavaScriptFrame* frame = GetFrame(); |
+ StandardFrame* frame0 = GetFrame(); |
+ if (frame0->is_wasm()) return false; |
+ |
+ JavaScriptFrame* frame = JavaScriptFrame::cast(frame0); |
+ |
Handle<ScopeInfo> scope_info(frame->function()->shared()->scope_info()); |
// Parameter might be shadowed in context. Don't stop here. |
bool result = SetParameterValue(scope_info, frame, variable_name, new_value); |
// Stack locals. |
- if (SetStackVariableValue(scope_info, frame, variable_name, new_value)) { |
+ if (SetStackVariableValue(scope_info, variable_name, new_value)) { |
return true; |
} |
@@ -690,10 +693,9 @@ bool ScopeIterator::SetInnerScopeVariableValue(Handle<String> variable_name, |
Handle<ScopeInfo> scope_info = CurrentScopeInfo(); |
DCHECK(scope_info->scope_type() == BLOCK_SCOPE || |
scope_info->scope_type() == EVAL_SCOPE); |
- JavaScriptFrame* frame = GetFrame(); |
// Setting stack locals of optimized frames is not supported. |
- if (SetStackVariableValue(scope_info, frame, variable_name, new_value)) { |
+ if (SetStackVariableValue(scope_info, variable_name, new_value)) { |
return true; |
} |