Commit Graph

49 Commits

Author SHA1 Message Date
Jared Wein
df72ffc760 Bug 1160424 - [Decoder Doctor] Show notification UI when a requested codec is missing but downloadable. r=gijs
MozReview-Commit-ID: BHPpLM96cg3

--HG--
rename : browser/base/content/browser-eme.js => browser/base/content/browser-media.js
2016-04-24 18:04:25 +10:00
Patrick Brosset
f469bf022f Bug 1264063 - 2 - Make the CPOW rule log errors and ignore ContentTask.spawn; r=Mossop
MozReview-Commit-ID: KN2MAgAvX2c

--HG--
extra : rebase_source : 099489c97f2b0fcae3903cbdd06d43b84e4113b1
2016-04-13 11:05:04 +02:00
Jarda Snajdr
af8bd60d6a Bug 1259184 - eslint-plugin-mozilla: import-globals-from throws errors in Atom editor. r=pbro 2016-03-23 12:32:00 +01:00
Dave Townsend
d4c054c8ac Bug 1257246: Fix addVarToScope to work in both eslint 1.x and eslint 2.x. r=pbrosset
Since we're already relying on internals it makes more sense to just use
escope's function for declaring variables. We then have to remove references
from the through array and update them to point to their variables, this was
cribbed from https://github.com/eslint/eslint/blob/master/lib/eslint.js#L180

MozReview-Commit-ID: JD7CFm1aO6T

--HG--
extra : rebase_source : ff5ab7359457db0cdae744523fa5f5da461ca154
2016-03-16 12:16:50 -07:00
Patrick Brosset
a31b063cce Bug 1246677 - 7 - Clean remaining ruleview and tests eslint warnings; r=jdescottes
MozReview-Commit-ID: BcyEv4fUWJZ

--HG--
extra : rebase_source : d589e9df51222df10db1e2095f5018d8c44bcb5a
2016-02-23 17:09:01 +01:00
Ryan VanderMeulen
b92db8e975 Backed out 10 changesets (bug 1246677) for causing frequent OSX browser_rules_completion-existing-property_01.js failures (10.6 and 10.10).
Backed out changeset a6d3a7a5e4ea (bug 1246677)
Backed out changeset 5dcb51fcef15 (bug 1246677)
Backed out changeset e450c5329a06 (bug 1246677)
Backed out changeset a65e8badc4c4 (bug 1246677)
Backed out changeset 0cdde48161bb (bug 1246677)
Backed out changeset bab3de413d37 (bug 1246677)
Backed out changeset e4f6cc6197cb (bug 1246677)
Backed out changeset 34e6b56e419d (bug 1246677)
Backed out changeset 5067508e5db4 (bug 1246677)
Backed out changeset 913b4129466e (bug 1246677)
2016-02-24 21:04:31 -05:00
Patrick Brosset
e8e084446b Bug 1246677 - 7 - Clean remaining ruleview and tests eslint warnings; r=jdescottes
MozReview-Commit-ID: BcyEv4fUWJZ

--HG--
extra : rebase_source : cb63ed3c966567fe298bf67cafdbf08e36118712
2016-02-23 17:09:01 +01:00
Dave Townsend
d450ff9b15 Bug 1245916: Import more head files for xpcshell tests. r=pbrosset
xpcshell tests used to use head_*.js files so this adds those for global
discovery.

MozReview-Commit-ID: BOsoGIpwdgu

--HG--
extra : rebase_source : ef36531641cbd353625019f8deba333cfd352891
extra : source : 70eca07367f40a9b4fe8c6e23ec0aef73bf2a962
2016-02-05 13:23:40 -08:00
Dave Townsend
688e1344df Bug 1245916: Add additional browser window scripts to eslint globals. r=felipe
This adds more of the scripts that browser.js relies on and also makes
browser-chrome head files import the browser.js globals.

The MOZ_JSDOWNLOADS block in contentAreaUtils only seems to hide a single
function, I don't see any need to keep hiding that now we're on by default.

MozReview-Commit-ID: 5zvF3JtJrZG

--HG--
extra : rebase_source : 94daff602b51d7ad57a24872d9eba9b304cf2da9
extra : source : b554c7ce41c42f16c2279ae88fd9567da7509bff
2016-02-05 12:16:39 -08:00
Dave Townsend
9d6c28bf7c Bug 1245916: XBL bindings should support global declarations in comments. r=miker
To properly lint XBL files we need to support things like import-globals-from
and other ESlint comment directives so we have to pass comments through to the
code blocks that ESlint parses. Unfortunately the way the XBL processor works
now is by passing a separate code block for every method/property/etc. in the
XBL and ESlint doesn't retain state across the blocks so we would have to prefix
every block with every comment. Instead this change makes us output just a
single block that roughly looks like this:

<comments>
var bindings = {
  "<binding-id>": {
    <binding-part-name>: function() { ... }
  }
}

This has some interesting bonuses. Defining the same ID twice will cause a lint
failure. Same for the same field in a binding. The line mapping is a little
harder and there are still a few lines that won't map directly back to the
original file but they should be rare cases. The only downside is that since
some bindings have the same binding declared differently for different platforms
we have to exclude those from linting for now.

MozReview-Commit-ID: CAsPt5dtf6T

--HG--
extra : rebase_source : 91a60ef0359ef53093fe197ed63dbc4e1a9f10a5
extra : source : 01675e4828b524c04a9057d68b41e9cc01ca1bb9
2016-02-05 12:13:34 -08:00
Dave Townsend
56d83fc4bd Bug 1245916: Unify eslint global discovery rules. r=pbrosset
While working on turning on no-undef I discovered that the various rules we
have for defining globals are a little inconsistent in whether the files they
load recurse through import-globals-from directives and none of them imported
eslint globals directives.

I think we're better off putting all this global parsing code in a single place
rather than spread across multiple rules. Have one rule to turn it on for
parsed files and one function to load globals from other files and make them
share most of the code so we won't get inconsistent. If we find us needing to
turn on/off individual features we can figure out a way to do that in the
future.

This patch does that, the globals.js file does all global parsing with a shared
object that receives events from the AST, either through from an ESlint rule
or from a simple AST walker using estraverse.

MozReview-Commit-ID: 9KQZwsNNOUl

--HG--
extra : rebase_source : 0f1cceca29ac398be97a55bbcd09fe58a8be1435
extra : source : 878db4caf845282f06542793bc4b5c24fa658c14
2016-02-05 11:37:50 -08:00
Phil Ringnalda
9dc941a05d Backed out 5 changesets (bug 1245916) for browser-chrome and devtools bustages
CLOSED TREE

Backed out changeset 70eca07367f4 (bug 1245916)
Backed out changeset 04c1740aa499 (bug 1245916)
Backed out changeset b554c7ce41c4 (bug 1245916)
Backed out changeset 01675e4828b5 (bug 1245916)
Backed out changeset 878db4caf845 (bug 1245916)
2016-02-15 13:58:27 -08:00
Dave Townsend
bc1ac20b7c Bug 1245916: Import more head files for xpcshell tests. r=pbrosset
xpcshell tests used to use head_*.js files so this adds those for global
discovery.

MozReview-Commit-ID: BOsoGIpwdgu

--HG--
extra : rebase_source : 0071e0fa7361e67e6c84bca2f4a0c5b1a3c634db
2016-02-05 13:23:40 -08:00
Dave Townsend
8f0976db4f Bug 1245916: Add additional browser window scripts to eslint globals. r=felipe
This adds more of the scripts that browser.js relies on and also makes
browser-chrome head files import the browser.js globals.

The MOZ_JSDOWNLOADS block in contentAreaUtils only seems to hide a single
function, I don't see any need to keep hiding that now we're on by default.

MozReview-Commit-ID: 5zvF3JtJrZG

--HG--
extra : rebase_source : a99f752b053765b621cf03965bda0c586a9eb1cb
2016-02-05 12:16:39 -08:00
Dave Townsend
5425cecf02 Bug 1245916: XBL bindings should support global declarations in comments. r=miker
To properly lint XBL files we need to support things like import-globals-from
and other ESlint comment directives so we have to pass comments through to the
code blocks that ESlint parses. Unfortunately the way the XBL processor works
now is by passing a separate code block for every method/property/etc. in the
XBL and ESlint doesn't retain state across the blocks so we would have to prefix
every block with every comment. Instead this change makes us output just a
single block that roughly looks like this:

<comments>
var bindings = {
  "<binding-id>": {
    <binding-part-name>: function() { ... }
  }
}

This has some interesting bonuses. Defining the same ID twice will cause a lint
failure. Same for the same field in a binding. The line mapping is a little
harder and there are still a few lines that won't map directly back to the
original file but they should be rare cases. The only downside is that since
some bindings have the same binding declared differently for different platforms
we have to exclude those from linting for now.

MozReview-Commit-ID: CAsPt5dtf6T

--HG--
extra : rebase_source : 700db61686d5eac3f05f758ad1ce505bcdb6aa7f
2016-02-05 12:13:34 -08:00
Dave Townsend
00913389de Bug 1245916: Unify eslint global discovery rules. r=pbrosset
While working on turning on no-undef I discovered that the various rules we
have for defining globals are a little inconsistent in whether the files they
load recurse through import-globals-from directives and none of them imported
eslint globals directives.

I think we're better off putting all this global parsing code in a single place
rather than spread across multiple rules. Have one rule to turn it on for
parsed files and one function to load globals from other files and make them
share most of the code so we won't get inconsistent. If we find us needing to
turn on/off individual features we can figure out a way to do that in the
future.

This patch does that, the globals.js file does all global parsing with a shared
object that receives events from the AST, either through from an ESlint rule
or from a simple AST walker using estraverse.

MozReview-Commit-ID: 9KQZwsNNOUl

--HG--
extra : rebase_source : 7c77b808d711cc863ff682af8d2de0c4853319b8
2016-02-05 11:37:50 -08:00
Mike Conley
7d205d0d55 Bug 1055464 - Add RefreshBlocker front-end. r=Mossop
--HG--
extra : commitid : 7BLpVqsfmjb
extra : rebase_source : 240331924d9d25b5d7142fc4541bffac7d423217
extra : amend_source : 5f3d6118132f8977f3176b5042a50231ab3fe0f1
2016-02-05 15:01:38 -05:00
Dave Townsend
16cd1b6be9 Bug 1245712: Fix the XBL processor's handling of columns and leading and trailing whitespace.
--HG--
extra : commitid : 8j5aSAX6UVU
extra : rebase_source : 640c982879e58f5ae10ca57eda4226262ecced5c
2016-02-03 16:50:01 -08:00
Tom Tromey
7fae99b3dc Bug 1241544 - add documentation for this-top-level-scope eslint rule; r=mikeratcliffe 2016-01-29 08:32:54 -07:00
J. Ryan Stinnett
4ed4b973e4 Bug 1242584 - import-globals-from should carry over to tests. r=tromey 2016-01-26 17:08:33 -06:00
J. Ryan Stinnett
c884cacc0c Bug 1242584 - Remove dead code in import-headjs-globals. r=tromey 2016-01-26 17:08:33 -06:00
Tom Tromey
0514beb89b Bug 1224289 - add eslint rule to reject Cu.importGlobalProperties; r=mikeratcliffe 2016-01-22 13:58:31 -07:00
Tom Tromey
78d2a32e06 Bug 1231963 - handle top-level "this.mumble" assignments in eslint; r=mikeratcliffe 2016-01-21 07:44:11 -07:00
Tom Tromey
76cf541122 Bug 1239426 - handle arrow functions in getASTSource; r=mikeratcliffe 2016-01-19 10:44:10 -07:00
Dave Townsend
47b0152e7a Bug 1229224: Add an eslint plugin for importing all browser.js globals for browser-chrome tests. r=miker
--HG--
extra : commitid : 5aYt0tOvUSV
extra : rebase_source : 08a1eaa364748ac9209f73e4aab4db0b53452265
extra : amend_source : 8571571251ad40a4a759b58b802b129c34b04be0
2015-12-17 15:33:32 -08:00
Dave Townsend
b84487234d Bug 1229224: Support more forms of defining globals and make anywhere we import scripts use them too. r=miker
We're attemping to find globals in JS from many places, this attempts to make
them all use the same methods. Since in some cases we're parsing new files we
can't use the eslint methods for getting the source so I've added a simple way
to convert from AST to a JS string.

--HG--
extra : commitid : DXo4A1fG3Gy
extra : rebase_source : 6a2a03d21d02331ae336c6b363d3951f4b6110aa
2015-12-17 15:31:48 -08:00
Tom Tromey
f7838034e2 Bug 1229911 - recognize DevToolsUtils.defineLazyGetter and defineLazyModuleGetter. r=miker 2015-12-16 13:25:00 +01:00
Dave Townsend
d0ae98c6c8 Bug 1231828: Fix XBL preprocesser to properly handle fields, entities and handlers. r=miker
Fixing some XBL files turned up some bugs in the preprocessor:

* XBL fields aren't just simple JS assignements, they are entire JS blocks which
  are evaluated and the result used for the field. So we don't need eslint to
  parse them as an assignment.
* XBL text can contain entities, in general just replacing every entity with a
  valid JS token should retain the meaning well enough for eslint's purposes.
* Events can have names that aren't valid JS identifiers so just don't use them.

--HG--
extra : commitid : 65gYzRiXqKe
extra : rebase_source : 9a6bcdd22f63b4aba52052f4f4ad0f20e6a2b446
2015-12-10 17:15:23 -05:00
Kris Maglione
b7869a821a Bug 1229874: Support defineLazyServiceGetter in components-import eslint helper. r=miker
--HG--
extra : commitid : JasCECgeDvZ
extra : rebase_source : 4f2bc306a845e8b2f561be4430d6741f44b204ec
extra : amend_source : 8955e75045f39f47b758587b635d7d2cec85f7f5
extra : source : 6745f48efb28b3ec118166e1211b02354ab01769
2015-12-02 16:49:50 -08:00
Dave Townsend
48323f5e76 Bug 1231867: Remove use of the spread operator to support node 4.2. r=miker
--HG--
extra : commitid : 56RoXh2T8JM
extra : rebase_source : 1d55bfbb97a042168cc608bce84897bf5700b5a6
2015-12-11 07:19:54 -05:00
Patrick Brosset
8b2a7c7941 Bug 1229859 - Introduce new import-globals-from eslint rule to import globals from other modules; r=Mossop
--HG--
extra : commitid : 3Qt8LBtIO0m
extra : histedit_source : 5907ea5fdfeaa84b116dcc87bfae96e90d2ead9f
2015-12-04 11:21:21 +01:00
Dave Townsend
e966ac1914 Bug 1229858: Add a preprocessor to convert XBL into JavaScript blocks for eslint. r=miker
--HG--
extra : commitid : KBrnZcg3l6i
extra : rebase_source : 0b961d96d021923d7ef2855367549b3aa2a077da
extra : amend_source : 7f403c59c018656bcff98e7fc2996bfbb9b853d3
2015-12-02 17:03:33 -08:00
Patrick Brosset
c21276e895 Bug 1230093 - Make the import-headjs-globals rule store variables correctly; r=Mossop
--HG--
extra : commitid : E3S2akSJ38y
extra : rebase_source : 3c7eea380147f97e290809f41bb8b8a95c05ea3c
2015-12-03 11:17:02 +01:00
Tom Tromey
2f425d9745 Bug 1224735 - only emit one error per possible CPOW use; r=miker,Ms2ger 2015-12-03 07:54:43 -07:00
Michael Ratcliffe
70823931ab Bug 1228363: Fixed eslint balanced-listeners rule to ignore listeners with no arguments. r=pbrosset
--HG--
extra : commitid : 4h60KEIjzn0
extra : rebase_source : 8c33f3639546c701b9e2d71d74af40cc1ea4c55b
2015-11-27 14:12:52 -08:00
Michael Ratcliffe
0520cbc652 Bug 1225289 - Make eslint plugin code conform to .eslintrc r=pbrosset
Added use strict statements now that we are no longer set up for ES6 modules.

--HG--
extra : commitid : BjJFvuFTZXZ
extra : rebase_source : 7781800bce61036a04734b858c8d7d13910377f1
2015-11-20 16:57:20 +00:00
Michael Ratcliffe
4a49c900a9 Bug 1225289 - Create appropriate .eslintrc for eslint-plugin-mozilla folder r=pbrosset
--HG--
extra : commitid : KJ27ZjmERRc
extra : rebase_source : 3477b633c9eb2f7bf68116f917e82ab0bd72d5dc
extra : amend_source : 76c679b125b5a9c94d95591d2d56d08b4f187b06
2015-11-20 16:55:58 +00:00
Michael Ratcliffe
5ac2b8706d Bug 1217922 - eslint head.js plugin does not seem to work r=pbrosset
--HG--
extra : commitid : 7lU7InBJixs
extra : rebase_source : df9d023a5e87aaa593d6fdbe96577765739641e6
extra : amend_source : 6158d4ffd46cf0fbf7f69ce9d4266279f5f29a10
2015-11-20 16:51:48 +00:00
Michael Ratcliffe
44786e5ba4 Bug 1222232 - Help mach eslint find espree and escope r=pbrosset
--HG--
extra : commitid : 2Wnf9u36M9V
extra : rebase_source : d6360c430b7653e2fcf3d6576c7cf5f86b4ab922
extra : amend_source : 6c5ddfd558420210179b352b105cb0fe9ad93b0b
2015-11-20 16:28:57 +00:00
Tom Tromey
77c4a729db Bug 1224735 - don't use "for..of" in eslint plugin. r=miker
--HG--
extra : rebase_source : 4d7d04b4b59ba28318ba0b0180c09e9b3db097e4
2015-11-16 07:47:00 +01:00
Michael Ratcliffe
65b3f9f335 Bug 1218412 - Create ESLint rule to check for CPOWS in browser mochitests r=pbrosset
--HG--
extra : transplant_source : %A8%14Q%E4n%F4%A8%001%B7F%5D%04WO%A2A%CFY%D4
2015-10-30 17:24:45 +00:00
Patrick Brosset
c1e49d5de4 Bug 1218425 - ESLint rule that warns against aArg notation in function params; r=miker
--HG--
extra : rebase_source : a8bd5eb51bf883a1a944dc14f7a7f1596326906f
2015-10-28 08:32:02 +01:00
Patrick Brosset
1f0548556f Bug 1218409 - Eslint rule that checks for balanced listeners. r=miker
--HG--
extra : rebase_source : f58a5e12f328e22a739167fada8b831f992915e7
2015-10-27 11:21:46 +01:00
Michael Ratcliffe
765d14495b Bug 1217851 - Fix mozplugin's import-headjs-globals on Windows. r=pbro
--HG--
extra : transplant_source : %03%94%CF%F9%DF6%BB%7Ce%13%000%EB%2B%21%15%ADO%08%C1
2015-10-26 13:16:03 +00:00
Michael Ratcliffe
d6f393f177 Bug 1205814 - Missed a brief description in rst docs r=pbrosset
--HG--
extra : transplant_source : s%BE%95r%3E%97%CD%A5%28P%F5%3BS%92%D6kV%E9P%ED
2015-10-26 14:47:54 +00:00
Michael Ratcliffe
97c2615aec Bug 1205814 - mozilla eslint plug: allow top level var only r=pbrosset
--HG--
extra : transplant_source : %F2%20%B4%BB%C6%E6%1C%9A%89c%FC%8E%3Bv%0C%E6%95%F9H8
2015-10-26 14:39:47 +00:00
J. Ryan Stinnett
6335fd7480 Bug 1203159 - Clean up various incorrect paths. r=ochameau 2015-10-21 12:48:55 -05:00
J. Ryan Stinnett
986f2a5cde Bug 1203159 - Rewrite DevTools resource URLs. r=ochameau 2015-10-21 12:48:53 -05:00
Michael Ratcliffe
3efb3a9e6f Bug 1203520 - We need a DevTools ESLint plugin containing our ruleset r=gps
--HG--
extra : commitid : FrMOnVBUxmY
extra : rebase_source : c38511e94177f651a0decad41180991c54cb0f33
2015-09-30 14:44:48 +01:00