Revert "Fixed reading from STDIN."
It breaks usage like this:
echo '...code...' | uglifyjs
This reverts commit e48802ad29.
This commit is contained in:
@@ -335,8 +335,9 @@ function getOptions(x, constants) {
|
|||||||
|
|
||||||
function read_whole_file(filename) {
|
function read_whole_file(filename) {
|
||||||
if (filename == "-") {
|
if (filename == "-") {
|
||||||
var size = fs.fstatSync(process.stdin.fd).size;
|
// XXX: this sucks. How does one read the whole STDIN
|
||||||
return size > 0 ? fs.readSync(process.stdin.fd, size)[0] : "";
|
// synchronously?
|
||||||
|
filename = "/dev/stdin";
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return fs.readFileSync(filename, "utf8");
|
return fs.readFileSync(filename, "utf8");
|
||||||
|
|||||||
Reference in New Issue
Block a user