1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 11:04:11 +01:00

Replace expression closures (methods).

Expression closures are to be axed. See https://bugzil.la/1083458.
This commit is contained in:
Doug Kearns
2015-07-23 01:55:32 +10:00
parent c035aa936b
commit 77d59cdfd1
45 changed files with 1595 additions and 1045 deletions

View File

@@ -300,8 +300,9 @@ var IO = Module("io", {
File: Class.Memoize(function () {
let io = this;
return Class("File", File, {
init: function init(path, checkCWD=true)
init.supercall(this, path, checkCWD && io.cwd)
init: function init(path, checkCWD=true) {
return init.supercall(this, path, checkCWD && io.cwd);
}
});
}),
@@ -530,11 +531,13 @@ var IO = Module("io", {
function result(status, output) {
return {
__noSuchMethod__: function (meth, args) apply(this.output, meth, args),
valueOf: function () this.output,
__noSuchMethod__: function (meth, args) {
return apply(this.output, meth, args);
},
valueOf: function () { return this.output; },
output: output.replace(/^(.*)\n$/, "$1"),
returnValue: status,
toString: function () this.output
toString: function () { return this.output; }
};
}