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)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.2 S14 (12june)

People

(Reporter: ShellHacker, Assigned: kgrandon)

References

Details

Attachments

(2 files)

No description provided.
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)
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)
Yeah lets land the in progress PR first. Yup, you're right, looks like the same issue as that of bug 1084242
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)
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)
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)
Updated the patch. Hopefully this should fix it. Thanks !
Flags: needinfo?(kgrandon)
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)
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)
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)
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)
That is the same problem with the other files since most of them have `this` in global scope.
(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)
Any progress with this Kevin ?
Flags: needinfo?(kgrandon)
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)
We should try using `self` or perhaps the jshint `worker` option here for the time being.
Assignee: nobody → sudheesh1995
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)
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)
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
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S14 (12june)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: