}
}
}
void renderDebuggerCallFrame() {
CallFrame callFrame = debuggerState.getActiveCallFrame();
if (callFrame == null) {
// Debugger is not paused. Remove the previous scope tree UI.
debuggingSidebar.setScopeVariablesRootNodes(null);
debuggingSidebar.refreshWatchExpressions();
return;
}
// Render the Scope Variables pane.
JsonArray<RemoteObjectNode> rootNodes = JsonCollections.createArray();
JsonArray<Scope> scopeChain = callFrame.getScopeChain();
for (int i = 0, n = scopeChain.size(); i < n; ++i) {
Scope scope = scopeChain.get(i);
String name = StringUtils.capitalizeFirstLetter(scope.getType().toString());
RemoteObject remoteObject = scope.getObject();
RemoteObjectNode.Builder scopeNodeBuilder = new RemoteObjectNode.Builder(name, remoteObject)
.setOrderIndex(i)
.setWritable(false)
.setDeletable(false)
.setTransient(scope.isTransient());
// Append the call frame "this" object to the top scope.
if (i == 0 && callFrame.getThis() != null) {
RemoteObjectNode thisNode = new RemoteObjectNode.Builder("this", callFrame.getThis())
.setWritable(false)
.setDeletable(false)
.build();
RemoteObjectNode scopeNode = scopeNodeBuilder
.setHasChildren(true) // At least will contain the "this" child.