Closed Bug 1133282 Opened 10 years ago Closed 10 years ago

Remove nonstandard expression closures from netwerk

Categories

(Core :: Networking, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file)

Attached patch exclo-netwerk.patch (deleted) — Splinter Review
Expression closures (shorthand function syntax) are a nonstandard SpiderMonkey feature we would like to remove (in bug 1083459).
Attachment #8564658 - Flags: review?(mcmanus)
Comment on attachment 8564658 [details] [diff] [review] exclo-netwerk.patch Review of attachment 8564658 [details] [diff] [review]: ----------------------------------------------------------------- thanks rs=mcmanus
Attachment #8564658 - Flags: review?(mcmanus) → review+
Comment on attachment 8564658 [details] [diff] [review] exclo-netwerk.patch >+ _getParameters() { >+ return { >+ "%DATE%": function() { return Date.now().toString(); }, >+ "%PRODUCT%": function() { return gApp.name; }, >+ "%APP_ID%": function() { return gApp.ID; }, >+ "%APP_VERSION%": function() { return gApp.version; }, >+ "%BUILD_ID%": function() { return gApp.appBuildID; }, >+ "%OS%": function() { return gApp.OS; }, >+ "%CHANNEL%": function() { return UpdateChannel.get(); }, >+ "%DISTRIBUTION%": function() { return this._getPref(PREF_APP_DISTRIBUTION, ""); }, >+ "%DISTRIBUTION_VERSION%": function() { return this._getPref(PREF_APP_DISTRIBUTION_VERSION, ""); }, >+ }; >+ }, > > _getUpdateURL: function() { > let url = this._getPref(PREF_UPDATES_URL, ""); > let params = this._getParameters(); > return url.replace(/%[A-Z_]+%/g, function(match) { > let param = params[match]; > // preserve the %FOO% string (e.g. as an encoding) if it's not a valid parameter > return param ? encodeURIComponent(param()) : match; _getParameters() is missing the colon & function keyword.
(In reply to Dave Garrett from comment #2) > Comment on attachment 8564658 [details] [diff] [review] > exclo-netwerk.patch > > >+ _getParameters() { > ... > > _getParameters() is missing the colon & function keyword. ES6 method syntax allows `: function` to be omitted in object literals: https://github.com/google/traceur-compiler/wiki/LanguageFeatures#property-method-assignment
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: