Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/node_shell_read.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
var ret;
#if SUPPORT_BASE64_EMBEDDING
ret = tryParseAsDataURI(filename);
if (!ret) {
#endif
if (!nodeFS) nodeFS = require('fs');
if (!nodePath) nodePath = require('path');
filename = nodePath['normalize'](filename);
ret = nodeFS['readFileSync'](filename);
#if SUPPORT_BASE64_EMBEDDING
if (ret) {
return binary ? ret : ret.toString();
}
#endif
return binary ? ret : ret.toString();
if (!nodeFS) nodeFS = require('fs');
if (!nodePath) nodePath = require('path');
filename = nodePath['normalize'](filename);
return nodeFS['readFileSync'](filename, binary ? null : 'utf8');
};

readBinary = function readBinary(filename) {
Expand Down
2 changes: 1 addition & 1 deletion src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ if (typeof process === 'object' && typeof process.versions === 'object' && typeo
var nodeFS = require('fs');

var nodeRead = function(filename) {
return nodeFS.readFileSync(filename).toString();
return nodeFS.readFileSync(filename, 'utf8');
};

function globalEval(x) {
Expand Down