Permalink
Browse files

support undefined and null

  • Loading branch information...
1 parent 369e382 commit 69b7634962d4cefea5fe0ae3cb754560fd960bf7 @paulrouget committed Aug 31, 2012
Showing with 6 additions and 5 deletions.
  1. +1 −1 Makefile
  2. +5 −4 chrome/jsterm.js
  3. BIN jsterm.xpi
View
@@ -6,4 +6,4 @@ FILES = chrome/ \
all:
rm -f jsterm.xpi && zip -r jsterm.xpi $(FILES)
- wget --post-file=$(PWD)/jsterm.xpi http://localhost:8889/
+ wget --post-file=$(PWD)/jsterm.xpi http://localhost:8888/
View
@@ -303,8 +303,11 @@ let JSTermUI = {
let isAString = (typeof result) == "string";
let resultStr;
- if (result == undefined) {
+ if (result === undefined) {
resultStr = "undefined";
+ } else if(result === null) {
+ resultStr = "null";
+ isAnObject = false;
} else if (isAString) {
resultStr = "\"" + result + "\"";
} else if (isAnArray) {
@@ -313,8 +316,7 @@ let JSTermUI = {
resultStr = result.toString();
}
- if (code == resultStr ||
- (result == undefined)) {
+ if (code == resultStr) {
return;
}
@@ -337,7 +339,6 @@ let JSTermUI = {
}
this.print(resultStr, startWith = "", isAnObject, isAnObject ? result : null);
-
},
isMultiline: function(text) {
View
Binary file not shown.

0 comments on commit 69b7634

Please sign in to comment.