Skip to content
Browse files

Don't insert \n brutely in code to be evalued. It will break code

sometimes. eg:
cause a ILLEGAL token error. Eg:
{"a":"b"} -> {"a\n":"b"} the eval will fail
  • Loading branch information...
1 parent 130b181 commit fc3c940ec90b39aa0b22aaf725198f04f6f90381 @michalliu committed
Showing with 4 additions and 4 deletions.
  1. +3 −3 autoload/javascript/jsrunner/runjs.js
  2. +1 −1 autoload/javascript/jsrunner/runjs.wsf
View
6 autoload/javascript/jsrunner/runjs.js
@@ -57,7 +57,7 @@ var readSTDIN = (function() {
});
stdin.on('end', function(chunk) {
- callback(body.join('\n'));
+ callback(body.join(''));
});
};
@@ -73,7 +73,7 @@ var readSTDIN = (function() {
lines.push(stdin.readLine());
}
- callback(lines.join('\n'));
+ callback(lines.join(''));
};
// readSTDIN() definition for Spidermonkey
@@ -96,7 +96,7 @@ var readSTDIN = (function() {
}
input.splice(-emptyCount);
- callback(input.join('\n'));
+ callback(input.join(''));
};
}
})();
View
2 autoload/javascript/jsrunner/runjs.wsf
@@ -38,7 +38,7 @@ var readSTDIN = function() {
input.push(line);
}
- return input.join("\n");
+ return input.join("");
};
var body = readSTDIN() || arguments[0];

0 comments on commit fc3c940

Please sign in to comment.
Something went wrong with that request. Please try again.