summaryrefslogtreecommitdiffstats
path: root/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js')
-rw-r--r--tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js
new file mode 100644
index 0000000000..30d8e0eb9c
--- /dev/null
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js
@@ -0,0 +1,25 @@
+/**
+ * @fileoverview Defines the environment for jsm files.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/.
+ */
+
+"use strict";
+
+module.exports = {
+ globals: {
+ // These globals are hard-coded and available in .jsm scopes.
+ // https://searchfox.org/mozilla-central/rev/dcb0cfb66e4ed3b9c7fbef1e80572426ff5f3c3a/js/xpconnect/loader/mozJSModuleLoader.cpp#222-223
+ // Although `debug` is allowed for jsm files, this is non-standard and something
+ // we don't want to allow in mjs files. Hence it is not included here.
+ atob: false,
+ btoa: false,
+ dump: false,
+ // The WebAssembly global is available in most (if not all) contexts where
+ // JS can run. It's definitely available in JSMs. So even if this is not
+ // the perfect place to add it, it's not wrong, and we can move it later.
+ WebAssembly: false,
+ },
+};