tweak all those copies of uriFromPath, #56691

This commit is contained in:
Johannes Rieken
2018-08-24 10:52:47 +02:00
parent 8af86c73e6
commit 7a6a466cab
7 changed files with 36 additions and 37 deletions

View File

@@ -38,12 +38,12 @@ function uriFromPath(_path) {
pathName = '/' + pathName;
}
return encodeURI('file://' + pathName);
return encodeURI('file://' + pathName).replace(/#/g, '%23');
}
function readFile(file) {
return new Promise(function(resolve, reject) {
fs.readFile(file, 'utf8', function(err, data) {
return new Promise(function (resolve, reject) {
fs.readFile(file, 'utf8', function (err, data) {
if (err) {
reject(err);
return;
@@ -102,7 +102,7 @@ function main() {
if (nlsConfig._resolvedLanguagePackCoreLocation) {
let bundles = Object.create(null);
nlsConfig.loadBundle = function(bundle, language, cb) {
nlsConfig.loadBundle = function (bundle, language, cb) {
let result = bundles[bundle];
if (result) {
cb(undefined, result);