diff --git a/common/content/commandline.js b/common/content/commandline.js index f8d89139..d491446b 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1363,7 +1363,7 @@ const CommandLine = Module("commandline", { this.wildIndex = util.Math.constrain(this.wildIndex + 1, 0, this.wildtypes.length - 1); this.preview(); - this._statusTimer.tell(); + commandline._statusTimer.tell(); } if (this.items.length == 0) diff --git a/common/content/commands.js b/common/content/commands.js index ac598fca..84de5119 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -1076,7 +1076,7 @@ const Commands = Module("commands", { arguments: [cmd.name], literalArg: cmd.replacementText } - for ([k, cmd] in Iterator(this._exCommands)) + for ([k, cmd] in Iterator(commands._exCommands)) if (cmd.user && cmd.replacementText) ] }); diff --git a/common/content/io.js b/common/content/io.js index 5537af4d..3a0912de 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -58,9 +58,9 @@ const File = Class("File", { else file.initWithPath(expandedPath); } - file = XPCSafeJSObjectWrapper(file); - file.__proto__ = File.prototype; - return file; + let self = XPCSafeJSObjectWrapper(file); + self.__proto__ = File.prototype; + return self; }, /** @@ -154,9 +154,9 @@ const File = Class("File", { encoding = options["fileencoding"]; if (mode == ">>") - mode = self.MODE_WRONLY | self.MODE_CREATE | self.MODE_APPEND; + mode = File.MODE_WRONLY | File.MODE_CREATE | File.MODE_APPEND; else if (!mode || mode == ">") - mode = self.MODE_WRONLY | self.MODE_CREATE | self.MODE_TRUNCATE; + mode = File.MODE_WRONLY | File.MODE_CREATE | File.MODE_TRUNCATE; if (!perms) perms = 0644; @@ -186,6 +186,59 @@ const File = Class("File", { return true; }, }, { + /** + * @property {number} Open for reading only. + * @final + */ + MODE_RDONLY: 0x01, + + /** + * @property {number} Open for writing only. + * @final + */ + MODE_WRONLY: 0x02, + + /** + * @property {number} Open for reading and writing. + * @final + */ + MODE_RDWR: 0x04, + + /** + * @property {number} If the file does not exist, the file is created. + * If the file exists, this flag has no effect. + * @final + */ + MODE_CREATE: 0x08, + + /** + * @property {number} The file pointer is set to the end of the file + * prior to each write. + * @final + */ + MODE_APPEND: 0x10, + + /** + * @property {number} If the file exists, its length is truncated to 0. + * @final + */ + MODE_TRUNCATE: 0x20, + + /** + * @property {number} If set, each write will wait for both the file + * data and file status to be physically updated. + * @final + */ + MODE_SYNC: 0x40, + + /** + * @property {number} With MODE_CREATE, if the file does not exist, the + * file is created. If the file already exists, no action and NULL + * is returned. + * @final + */ + MODE_EXCL: 0x80, + expandPathList: function (list) list.split(",").map(this.expandPath).join(","), @@ -310,59 +363,6 @@ const IO = Module("io", { */ File: File, - /** - * @property {number} Open for reading only. - * @final - */ - MODE_RDONLY: 0x01, - - /** - * @property {number} Open for writing only. - * @final - */ - MODE_WRONLY: 0x02, - - /** - * @property {number} Open for reading and writing. - * @final - */ - MODE_RDWR: 0x04, - - /** - * @property {number} If the file does not exist, the file is created. - * If the file exists, this flag has no effect. - * @final - */ - MODE_CREATE: 0x08, - - /** - * @property {number} The file pointer is set to the end of the file - * prior to each write. - * @final - */ - MODE_APPEND: 0x10, - - /** - * @property {number} If the file exists, its length is truncated to 0. - * @final - */ - MODE_TRUNCATE: 0x20, - - /** - * @property {number} If set, each write will wait for both the file - * data and file status to be physically updated. - * @final - */ - MODE_SYNC: 0x40, - - /** - * @property {number} With MODE_CREATE, if the file does not exist, the - * file is created. If the file already exists, no action and NULL - * is returned. - * @final - */ - MODE_EXCL: 0x80, - /** * @property {Object} The current file sourcing context. As a file is * being sourced the 'file' and 'line' properties of this context @@ -871,7 +871,7 @@ lookup: liberator.assert(args.length <= 1, "E172: Only one file name allowed"); let filename = args[0] || io.getRCFile(null, true).path; - let file = io.File(filename); + let file = File(filename); liberator.assert(!file.exists() || args.bang, "E189: \"" + filename + "\" exists (add ! to override)"); diff --git a/common/content/mappings.js b/common/content/mappings.js index 21ade1b3..c39318f6 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -419,7 +419,7 @@ const Mappings = Module("mappings", { arguments: [map.names[0]], literalArg: map.rhs } - for (map in this._mappingsIterator(modes, this._user)) + for (map in mappings._mappingsIterator(modes, mappings._user)) if (map.rhs && map.noremap == noremap && !isMultiMode(map, this.name)) ]; } diff --git a/common/content/style.js b/common/content/style.js index ba6ee58f..5223e25a 100644 --- a/common/content/style.js +++ b/common/content/style.js @@ -729,7 +729,7 @@ Module("highlight", { if (scheme == "default") highlight.clear(); else - liberator.assert(!io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]), + liberator.assert(io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]), "E185: Cannot find color scheme " + scheme); autocommands.trigger("ColorScheme", { name: scheme }); },