Skip to content

Commit

Permalink
Make print handle booleans and numbers (NaN)
Browse files Browse the repository at this point in the history
  • Loading branch information
longouyang committed Sep 21, 2016
1 parent e8ae6a6 commit 5cafebe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ var CodeEditor = React.createClass({
if (x.__print__) {
return k(s, x.__print__(x));
} else {
var type = typeof x;
this.addResult({type: 'text',
message: typeof x == 'object' ? JSON.stringify(x) : x})
message: _.contains(['object', 'boolean', 'number'], type) ? JSON.stringify(x) : x})
return k(s)
}
},
Expand Down

0 comments on commit 5cafebe

Please sign in to comment.