Closed
Bug 1084243
Opened 11 years ago
Closed 11 years ago
Fix remaining hint problems in shared/js
Categories
(Firefox OS Graveyard :: Gaia::Shared, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.2 S14 (12june)
People
(Reporter: ShellHacker, Assigned: kgrandon)
References
Details
Attachments
(2 files)
No description provided.
| Reporter | ||
Comment 1•11 years ago
|
||
Fixed all files that are not in shared/js/media or shared/js/fb
Having trouble with shared/js/keyboard_helper.js which keeps complaining for possible strict violation
Flags: needinfo?(kgrandon)
| Assignee | ||
Comment 2•11 years ago
|
||
Do you want to upload the in-progress pull request first? Maybe we can land that and handle keyboard_helper.js by itself at the end? Seems like we need to find a solution, and it may be the same as bug 1084242?
Flags: needinfo?(kgrandon)
| Reporter | ||
Comment 3•11 years ago
|
||
Yeah lets land the in progress PR first. Yup, you're right, looks like the same issue as that of bug 1084242
| Assignee | ||
Comment 4•11 years ago
|
||
Hey Sudheesh - any chance you could upload the pull request with most of the files passing JSHint? It would help. Thank you!
Flags: needinfo?(sudheesh1995)
| Reporter | ||
Comment 5•11 years ago
|
||
I am extremely sorry for the delay Kevin. I have attached the PR containing the patch to this.
Flags: needinfo?(sudheesh1995)
Attachment #8515413 -
Flags: review?(kgrandon)
| Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 8515413 [details] [review]
https://github.com/mozilla-b2g/gaia/pull/25714
Thank you for the patch. I think we're getting close here, but there are a few things we need to investigate before we can land this. Please address and re-flag me when ready. Thanks!
Attachment #8515413 -
Flags: review?(kgrandon)
| Reporter | ||
Comment 7•11 years ago
|
||
Updated the patch. Hopefully this should fix it. Thanks !
Flags: needinfo?(kgrandon)
| Assignee | ||
Comment 8•11 years ago
|
||
Looking good, but we're still seeing several linter failures here: https://treeherder.mozilla.org/ui/#/jobs?repo=gaia-try&revision=ec83d5536a5e
Can you look into it? Thanks!
Flags: needinfo?(kgrandon)
| Reporter | ||
Comment 9•11 years ago
|
||
The only issue I see is the Strict violation. I am unable to figure out what to exactly do. I am sorry for the delay in replying here, Had my routine mid semester examinations this whole week
Flags: needinfo?(kgrandon)
| Assignee | ||
Comment 10•11 years ago
|
||
Hey Sudheesh - I think generally this is because we try to call a function with .call() or .apply(). To let jshint know this is ok, I think we can annotate these functions with a jshint tag. Can you try placing the following tag inside each function that needs this, and let me know if it works?
/* jshint validthis: true */
Flags: needinfo?(kgrandon) → needinfo?(sudheesh1995)
| Reporter | ||
Comment 11•11 years ago
|
||
In fb_data_reader.js, the file when modified to be
- var fb = this.fb || {};
- this.fb = fb;
(function() {
+ var fb = this.fb || {};
+ this.fb = fb;
Works perfectly, In the rest of the files, the this.fb is at a global scope and jshint validthis:true can only be used at a local scope. On using it, it provides the following error.
Option 'validthis' can't be used in a global scope.
Flags: needinfo?(sudheesh1995) → needinfo?(kgrandon)
| Reporter | ||
Comment 12•11 years ago
|
||
That is the same problem with the other files since most of them have `this` in global scope.
| Assignee | ||
Comment 13•11 years ago
|
||
(In reply to Sudheesh Singanamalla (:ShellHacker) [Exams Nov 18 - Dec 5] from comment #12)
> That is the same problem with the other files since most of them have `this`
> in global scope.
Hmm, this is going to need some investigation. I *think* what we want to do is use the `self` variable, instead of `this`, but I need to do some investigation first.
We also have bug 1084642 filed which is similar - to devise a simple pattern for all of the scripts in shared/ to use.
Flags: needinfo?(kgrandon)
| Assignee | ||
Comment 15•11 years ago
|
||
Not too much movement on this yet, sorry. We may want to get the files that don't have this problem landed while we investigate a solution. (So everything except fb_data_reader.js maybe?)
Recently I've been thinking about having each file export an ES6 module, but this is going to take a while to implement.
Flags: needinfo?(kgrandon)
| Assignee | ||
Comment 16•11 years ago
|
||
We should try using `self` or perhaps the jshint `worker` option here for the time being.
Assignee: nobody → sudheesh1995
| Assignee | ||
Comment 17•11 years ago
|
||
Sudheesh - do you have interest in finishing this up?
I think using the `self` var from a worker context would be our best path forward here. Let me know what you think. Thanks!
Flags: needinfo?(sudheesh1995)
| Reporter | ||
Comment 18•11 years ago
|
||
Kevin, I am slightly busy right now, I would fix this if its left but that'd take time, in case this is a blocker, it'd be great if you could go ahead with this.
Flags: needinfo?(sudheesh1995)
| Assignee | ||
Comment 19•11 years ago
|
||
Thank you very much for the info and contribution. I'll see if we can take what you have and rebase it against master to get it landed.
Assignee: sudheesh1995 → kgrandon
Status: NEW → ASSIGNED
Component: Gaia → Gaia::Shared
Comment 20•11 years ago
|
||
| Assignee | ||
Comment 21•11 years ago
|
||
Finally in master: https://github.com/mozilla-b2g/gaia/commit/f45e662fb738dc0c699a25a8e7e742eb8d196c3d
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Target Milestone: --- → 2.2 S14 (12june)
You need to log in
before you can comment on or make changes to this bug.
Description
•