From a62366d535de2e9573c89b7e9a734705995bb296 Mon Sep 17 00:00:00 2001 From: Konstantin Ulitin Date: Wed, 2 Nov 2016 11:09:49 +0300 Subject: [PATCH] WEB-17316 JS debugger: invoke getter on object, not it's prototype --- platform/script-debugger/debugger-ui/src/VariableView.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/script-debugger/debugger-ui/src/VariableView.kt b/platform/script-debugger/debugger-ui/src/VariableView.kt index 3f7ddedba47d..4d45ffc8d9a9 100644 --- a/platform/script-debugger/debugger-ui/src/VariableView.kt +++ b/platform/script-debugger/debugger-ui/src/VariableView.kt @@ -95,7 +95,12 @@ class VariableView(override val variableName: String, private val variable: Vari }, false) node.setFullValueEvaluator(object : XFullValueEvaluator(" (invoke getter)") { override fun startEvaluation(callback: XFullValueEvaluator.XFullValueEvaluationCallback) { - val valueModifier = variable.valueModifier + var valueModifier = variable.valueModifier + var nonProtoContext = context + while (nonProtoContext is VariableView && nonProtoContext.variableName == PROTOTYPE_PROP) { + valueModifier = nonProtoContext.variable.valueModifier + nonProtoContext = nonProtoContext.parent + } valueModifier!!.evaluateGet(variable, evaluateContext) .done(node) { callback.evaluated("") @@ -478,3 +483,5 @@ private class ArrayPresentation(length: Int, className: String?) : XValuePresent renderer.renderSpecialSymbol("]") } } + +private val PROTOTYPE_PROP = "__proto__" \ No newline at end of file