Commit ed559eae authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[debugger] fix function in suspended generator

R=szuend@chromium.org

Fixed: chromium:1075763
Change-Id: I7f67cfb9c643d8f30bec808ccb2a9e1326ad1921
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2170030Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67450}
parent 9d1b87ef
......@@ -773,7 +773,9 @@ bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode) const {
Variable* function_var =
current_scope_->AsDeclarationScope()->function_var();
if (function_var != nullptr) {
Handle<JSFunction> function = frame_inspector_->GetFunction();
Handle<JSFunction> function = frame_inspector_ == nullptr
? function_
: frame_inspector_->GetFunction();
Handle<String> name = function_var->name();
if (visitor(name, function)) return true;
}
......
Tests Runtime.evaluate returns object with undefined property.
{
id : <messageId>
result : {
result : {
className : f
description : f
objectId : <objectId>
preview : {
description : f
overflow : false
properties : [
[0] : {
name : [[GeneratorStatus]]
type : string
value : suspended
}
]
subtype : generator
type : object
}
subtype : generator
type : object
}
}
}
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let {session, contextGroup, Protocol} = InspectorTest.start(
'Tests Runtime.evaluate returns object with undefined property.');
(async function test() {
InspectorTest.logMessage(await Protocol.Runtime.evaluate({
expression: "(function* f() { yield f;})()",
generatePreview: true
}));
InspectorTest.completeTest();
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment