UNPKG

1.07 kBJavaScriptView Raw
1/**
2 * @fileoverview Reject common XPCOM methods called with useless optional
3 * parameters, or non-existent parameters.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10"use strict";
11
12// -----------------------------------------------------------------------------
13// Rule Definition
14// -----------------------------------------------------------------------------
15
16module.exports = function(context) {
17 // ---------------------------------------------------------------------------
18 // Public
19 // --------------------------------------------------------------------------
20
21 return {
22 "CallExpression": function(node) {
23 let callee = node.callee;
24 if (callee.type === "MemberExpression" &&
25 callee.object.type === "Identifier" &&
26 callee.object.name === "Task") {
27 context.report({node, message: "Task.jsm is deprecated."});
28 }
29 }
30 };
31};