fix nodejs debug regression (master)

This commit is contained in:
Vladimir Krivosheev
2014-11-28 12:19:04 +01:00
parent b3ef374ccd
commit 4cb053be35
4 changed files with 8 additions and 11 deletions
@@ -33,15 +33,13 @@ class DonePromise<T> extends Promise<T> implements Getter<T> {
@NotNull
@Override
public <SUB_RESULT> Promise<SUB_RESULT> then(@NotNull Function<T, SUB_RESULT> done) {
//noinspection unchecked
return (Promise<SUB_RESULT>)this;
return Promise.resolve(done.fun(result));
}
@NotNull
@Override
public <SUB_RESULT> Promise<SUB_RESULT> then(@NotNull AsyncFunction<T, SUB_RESULT> done) {
//noinspection unchecked
return (Promise<SUB_RESULT>)this;
return done.fun(result);
}
@NotNull
@@ -1,8 +1,8 @@
package org.jetbrains.debugger;
import com.intellij.openapi.util.AsyncResult;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.concurrency.Promise;
import java.util.List;
@@ -19,7 +19,7 @@ public interface CallFrame {
* Computed variable must be null if no receiver variable, call {@link com.intellij.openapi.util.AsyncResult#setDone(Object null)}
*/
@NotNull
AsyncResult<Variable> getReceiverVariable();
Promise<Variable> getReceiverVariable();
int getLine();
@@ -97,14 +97,14 @@ public class ScopeVariablesGroup extends XValueGroup {
return;
}
callFrame.getReceiverVariable().doWhenDone(new Consumer<Variable>() {
callFrame.getReceiverVariable().done(new Consumer<Variable>() {
@Override
public void consume(Variable variable) {
if (!node.isObsolete()) {
node.addChildren(variable == null ? XValueChildrenList.EMPTY : XValueChildrenList.singleton(CallFrameBase.RECEIVER_NAME, new VariableView(variable, context)), true);
}
}
}).doWhenRejected(new Consumer<String>() {
}).rejected(new Consumer<String>() {
@Override
public void consume(@Nullable String error) {
if (!node.isObsolete()) {
@@ -2,7 +2,6 @@ package org.jetbrains.debugger;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.SmartList;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.xdebugger.frame.XCompositeNode;
import com.intellij.xdebugger.frame.XValueChildrenList;
import org.jetbrains.annotations.NotNull;
@@ -57,7 +56,7 @@ public final class Variables {
}
}
ContainerUtil.sort(properties, memberFilter.hasNameMappings() ? new Comparator<Variable>() {
Collections.sort(properties, memberFilter.hasNameMappings() ? new Comparator<Variable>() {
@Override
public int compare(@NotNull Variable o1, @NotNull Variable o2) {
return naturalCompare(memberFilter.getName(o1), memberFilter.getName(o2));
@@ -144,7 +143,7 @@ public final class Variables {
}
private static void sort(@NotNull List<Variable> result) {
ContainerUtil.sort(result, NATURAL_NAME_COMPARATOR);
Collections.sort(result, NATURAL_NAME_COMPARATOR);
}
// prefixed '_' must be last, fixed case sensitive natural compare