[Debugger] Modify the object representation in case of variables request. (#2594)

Return with the object`s toString() method instead of create a json formated string from it.
It could have led to an error in previous cases (an object contains itself etc.)

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
Robert Sipka
2018-11-15 14:13:49 +01:00
committed by GitHub
parent 9535a230ba
commit 6c4b316609
2 changed files with 7 additions and 14 deletions
+1 -8
View File
@@ -492,14 +492,7 @@ jerry_debugger_send_scope_variables (const uint8_t *recv_buffer_p) /**< pointer
jerry_debugger_scope_variable_type_t variable_type = jerry_debugger_get_variable_type (prop_value_p.value);
if (variable_type == JERRY_DEBUGGER_VALUE_OBJECT)
{
property_value = ecma_builtin_json_string_from_object (prop_value_p.value);
}
else
{
property_value = ecma_op_to_string (prop_value_p.value);
}
property_value = ecma_op_to_string (prop_value_p.value);
if (!jerry_debugger_copy_variables_to_string_message (variable_type,
ecma_get_string_from_value (property_value),
+6 -6
View File
@@ -119,10 +119,10 @@ name | type | value
h | undefined | undefined
a | Array | [1,2,3]
(jerry-debugger) variables 2
name | type | value
b | Number | 10
x | Boolean | true
user | Object | {"name":"John","age":30}
m | Null | null
c | Number | 10
name | type | value
b | Number | 10
x | Boolean | true
user | Object | [object Object]
m | Null | null
c | Number | 10
(jerry-debugger) c