| 1 |
define(["dojo/has!host-node?./node/fs:./rhino/fs"], function(result){ |
| 2 |
|
| 3 |
var origReadFileSync = result.readFileSync; |
| 4 |
result.readFileSync = function(filename, encoding) { |
| 5 |
var text = origReadFileSync(filename, encoding); |
| 6 |
if(encoding == "utf8"){ |
| 7 |
text = text.replace(/^\uFEFF/, ''); |
| 8 |
} |
| 9 |
return text; |
| 10 |
}; |
| 11 |
|
| 12 |
var origReadFile = result.readFile; |
| 13 |
result.readFile = function(filename, encoding, cb){ |
| 14 |
origReadFile(filename, encoding, function(err, text){ |
| 15 |
if(text && encoding == "utf8"){ |
| 16 |
text = text.replace(/^\uFEFF/, ''); |
| 17 |
} |
| 18 |
cb(err, text); |
| 19 |
}); |
| 20 |
}; |
| 21 |
|
| 22 |
return result; |
| 23 |
}); |