Bug 1379256 - fix no-undef issues for toolkit/components/osfile. r=mossop

MozReview-Commit-ID: B0vImMrMGF6

--HG--
extra : rebase_source : c6b029c70781bae9cd18a83afa3225fc5155da54
This commit is contained in:
Dan Banner 2017-08-09 14:42:27 +01:00
Родитель 0cd53eb3ff
Коммит 7b9493ce4d
16 изменённых файлов: 37 добавлений и 3 удалений

Просмотреть файл

@ -8,7 +8,6 @@ module.exports = {
"no-redeclare": "off",
"no-self-assign": "off",
"no-shadow": "off",
"no-undef": "off",
"no-unused-vars": "off",
"object-shorthand": "off",
}

Просмотреть файл

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env worker */
if (this.Components) {
throw new Error("This worker can only be loaded from a worker thread");

Просмотреть файл

@ -17,6 +17,8 @@
* - a few additional utilities.
*/
/* eslint-env worker */
// Boilerplate used to be able to import this module both from the main
// thread and from worker threads.
@ -89,6 +91,7 @@ exports.Config = Config;
if (typeof Components != "undefined") {
// On the main thread, OS.Constants is defined by a xpcom
// component. On other threads, it is available automatically
/* global OS */
Cu.import("resource://gre/modules/ctypes.jsm");
Cc["@mozilla.org/net/osfileconstantsservice;1"].
getService(Ci.nsIOSFileConstantsService).init();

Просмотреть файл

@ -9,6 +9,9 @@
* be executed only on a worker thread.
*/
/* eslint-env node */
/* global OS */
if (typeof Components != "undefined") {
throw new Error("osfile_shared_front.jsm cannot be used from the main thread");
}

Просмотреть файл

@ -17,6 +17,8 @@
* - opened from a chrome worker through require().
*/
/* eslint-env node */
"use strict";
var SharedAll;

Просмотреть файл

@ -2,6 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env mozilla/chrome-worker, node */
/* global OS */
{
if (typeof Components != "undefined") {
// We do not wish osfile_unix_back.jsm to be used directly as a main thread

Просмотреть файл

@ -9,6 +9,9 @@
* This front-end is meant to be imported by a worker thread.
*/
/* eslint-env mozilla/chrome-worker, node */
/* global OS */
{
if (typeof Components != "undefined") {
// We do not wish osfile_unix_front.jsm to be used directly as a main thread

Просмотреть файл

@ -17,6 +17,8 @@
* - opened from a chrome worker through require().
*/
/* eslint-env node */
"use strict";
var SharedAll;

Просмотреть файл

@ -19,6 +19,9 @@
* (bug 729057)
*/
/* eslint-env mozilla/chrome-worker, node */
/* global OS */
{
if (typeof Components != "undefined") {
// We do not wish osfile_win.jsm to be used directly as a main thread

Просмотреть файл

@ -9,6 +9,9 @@
* This front-end is meant to be imported by a worker thread.
*/
/* eslint-env mozilla/chrome-worker, node */
/* global OS */
{
if (typeof Components != "undefined") {
// We do not wish osfile_win_front.jsm to be used directly as a main thread

Просмотреть файл

@ -15,6 +15,9 @@
* - all path concatenations go through function |join|.
*/
/* global OS */
/* eslint-env node */
"use strict";
if (typeof Components == "undefined") {

Просмотреть файл

@ -38,10 +38,10 @@ var maketest = function(prefix, test) {
okpromise: function okpromise(t, m) {
return t.then(
function onSuccess() {
util.ok(true, m);
utils.ok(true, m);
},
function onFailure() {
util.ok(false, m);
utils.ok(false, m);
}
);
}

Просмотреть файл

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-env mozilla/chrome-worker, node */
"use strict";
importScripts("worker_test_osfile_shared.js");

Просмотреть файл

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-env mozilla/chrome-worker, node */
importScripts("worker_test_osfile_shared.js");
importScripts("resource://gre/modules/workers/require.js");

Просмотреть файл

@ -1,6 +1,9 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-env mozilla/chrome-worker, node */
importScripts("worker_test_osfile_shared.js");
self.onmessage = function(msg) {

Просмотреть файл

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-env mozilla/chrome-worker, node */
importScripts("worker_test_osfile_shared.js");
self.onmessage = function(msg) {