final EvaluateContext evaluateContext =
(EvaluateContext) contextImpl.getAdapter(EvaluateContext.class);
if (evaluateContext == null) {
listener.watchEvaluationFinished(new BadWatchExpressionResult(
new DebugException(new Status(Status.ERROR,
ChromiumDebugUIPlugin.PLUGIN_ID,"Bad debug context")), //$NON-NLS-1$
expression));
return;
}
evaluateContext.getJsEvaluateContext().evaluateAsync(
expression, null,
new JsEvaluateContext.EvaluateCallback() {
public void success(JsVariable variable) {
final Variable var = Variable.forRealValue(evaluateContext, variable, false, null);
listener.watchEvaluationFinished(new GoodWatchExpressionResult(var, expression));
}
public void failure(String message) {
listener.watchEvaluationFinished(new BadWatchExpressionResult(new DebugException(
createErrorStatus(message == null
? Messages.JsWatchExpressionDelegate_ErrorEvaluatingExpression
: message, null)), expression));
return;
}