1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-24 05:45:49 +01:00

Replace expression closures (function declarations).

Expression closures are to be axed. See https://bugzil.la/1083458.
This commit is contained in:
Doug Kearns
2015-05-25 23:59:30 +10:00
parent 5ab1befbf7
commit c0b7c4c35d
31 changed files with 292 additions and 162 deletions

View File

@@ -528,13 +528,15 @@ var IO = Module("io", {
else if (input)
stdin.write(input);
function result(status, output) ({
__noSuchMethod__: function (meth, args) apply(this.output, meth, args),
valueOf: function () this.output,
output: output.replace(/^(.*)\n$/, "$1"),
returnValue: status,
toString: function () this.output
});
function result(status, output) {
return {
__noSuchMethod__: function (meth, args) apply(this.output, meth, args),
valueOf: function () this.output,
output: output.replace(/^(.*)\n$/, "$1"),
returnValue: status,
toString: function () this.output
};
}
function async(status) {
let output = stdout.read();
@@ -1000,7 +1002,9 @@ unlet s:cpo_save
context.advance(4);
// dir == "" is expanded inside readDirectory to the current dir
function getDir(str) str.match(/^(?:.*[\/\\])?/)[0];
function getDir(str) {
return str.match(/^(?:.*[\/\\])?/)[0];
}
dir = getDir(dir || context.filter);
let file = util.getFile(dir);