Closed
Bug 880083
Opened 12 years ago
Closed 10 years ago
Use const instead of var in code samples
Categories
(Developer Documentation Graveyard :: Add-ons, defect, P5)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: bruant.d, Assigned: sheppy)
References
Details
(Whiteboard: c=Addons u=mozdev p=0)
:: Developer Documentation Request
Request Type: Correction
Gecko Version: unspecified
Technical Contact:
:: Details
In JavaScript var-declaration has some known flaws. ES6 standardizes let and const which are already in Firefox (and available to addons). If I've been following well, with let and const, most variables have all the right reasons to be declared with const and var can be retired.
It could be good to show the way to devs in jetpack examples.
No rush of course, but to keep in mind.
Reference:
http://ariya.ofilabs.com/2013/05/es6-and-block-scope.html
http://blog.lassus.se/2013/05/defsjs.html
Assignee | ||
Comment 1•12 years ago
|
||
Will this break compatibility with other browsers? With older but still relatively recent browsers?
Reporter | ||
Comment 2•12 years ago
|
||
I meant to do that only for Jetpack-related doc.
Webdev/app doc will keep using 'var' for a looooooooooooooooooooooooooooooong time :-)
I felt Developer Documentation/add-ons was the proper product/component combo. Feel free to re-categorize if I'm mistaken.
Comment 3•12 years ago
|
||
Actually 'const' is *less* efficient than 'var' until we support ES6 const semantics.
Comment 4•10 years ago
|
||
Closing this, overkill. And const has not yet been updated. And JetPack is legacy technology now.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•