Skip to content

Commit 4099faf

Browse files
committed
fix console bug
1 parent 1938d6f commit 4099faf

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

  • notebookjs/src/public/javascripts

notebookjs/src/public/javascripts/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,27 @@ function exec_cell(c_id) {
5050
let output = ("global", eval)(vars_in_scope[id].getValue())
5151
if (Array.isArray(output)) {
5252
output = print_val(output)
53-
}
54-
else if (typeof output === 'object' && output !== null) {
53+
} else if (typeof output === 'object' && output !== null) {
5554
output = JSON.stringify(output)
56-
}
57-
else if (console) {
55+
if (output == "{}") {
56+
output = ""
57+
}
58+
} else if (console) {
5859
//retreive value from the console funcction
5960
console.oldLog = console.log;
6061
console.log = function (value) {
6162
return value;
6263
};
6364
output = eval(vars_in_scope[id].getValue());
65+
6466
if (Array.isArray(output)) {
6567
output = print_val(output)
6668
} else {
6769
if (typeof output === 'object' && output !== null) {
6870
output = JSON.stringify(output)
71+
if (output == "{}") {
72+
output = ""
73+
}
6974
}
7075

7176
}

0 commit comments

Comments
 (0)