Bug 1425244 - Enable ESLint rule no-new-object for accessible/tests/mochitest/. r?surkov
MozReview-Commit-ID: AU5AlyOdgoy
--- a/accessible/tests/mochitest/.eslintrc.js
+++ b/accessible/tests/mochitest/.eslintrc.js
@@ -7,15 +7,14 @@ module.exports = {
"rules": {
"mozilla/no-cpows-in-tests": "error",
"mozilla/reject-importGlobalProperties": "error",
// XXX These are rules that are enabled in the recommended configuration, but
// disabled here due to failures when initially implemented. They should be
// removed (and hence enabled) at some stage.
"no-nested-ternary": "off",
- "no-new-object": "off",
"no-redeclare": "off",
"no-shadow": "off",
"no-undef": "off",
"space-unary-ops": "off",
}
};
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -719,18 +719,18 @@ function getTextFromClipboard() {
createInstance(Components.interfaces.nsITransferable);
trans.init(getLoadContext());
if (!trans)
return "";
trans.addDataFlavor("text/unicode");
clip.getData(trans, clip.kGlobalClipboard);
- var str = new Object();
- var strLength = new Object();
+ var str = {};
+ var strLength = {};
trans.getTransferData("text/unicode", str, strLength);
if (str)
str = str.value.QueryInterface(Components.interfaces.nsISupportsString);
if (str)
return str.data.substring(0, strLength.value / 2);
return "";