Closed Bug 1103597 Opened 11 years ago Closed 11 years ago

ES6 CONST causes loadSubScript("chrome://messenger/content/pref-mailnews.js") failed: SyntaxError: const declaration not directly within block

Categories

(SeaMonkey :: Preferences, defect)

defect
Not set
normal

Tracking

(seamonkey2.33 fixed)

RESOLVED FIXED
seamonkey2.33
Tracking Status
seamonkey2.33 --- fixed

People

(Reporter: philip.chee, Assigned: philip.chee)

Details

Attachments

(1 file, 1 obsolete file)

Sun Nov 23 2014 21:13:58 Error: prefpane.paneload: loadSubScript("chrome://messenger/content/pref-mailnews.js") failed: SyntaxError: const declaration not directly within block Source file: chrome://communicator/content/bindings/prefwindow.xml Line: 523 See Bug 611388 - const should be block-scoped and an initializer should be required
Attached patch Patch v1.0 fix use of CONST (obsolete) — Splinter Review
> -if ("@mozilla.org/suite/shell-service;1" in Components.classes) > - const nsIShellService = Components.interfaces.nsIShellService; > +const nsIShellService = "@mozilla.org/suite/shell-service;1" in Components.classes ? > + Components.interfaces.nsIShellService : null; ... > - if ("@mozilla.org/suite/shell-service;1" in Components.classes) try { > + if (nsIShellService) try { I wonder if I could just use: const nsIShellService = Components.interfaces.nsIShellService; and then rely on truthy/falsy: if (nsIShellService) {....} I'll open a separate bug to audit /suite/ for non ES6 compliant uses of CONST.
Assignee: nobody → philip.chee
Status: NEW → ASSIGNED
Attachment #8527309 - Flags: review?(neil)
Comment on attachment 8527309 [details] [diff] [review] Patch v1.0 fix use of CONST Not really want I want, sorry. Just change it to var for now.
Attachment #8527309 - Flags: review?(neil) → review-
(In reply to neil@parkwaycc.co.uk from comment #2) > Comment on attachment 8527309 [details] [diff] [review] > Not really want I want, sorry. Just change it to var for now. OK. Done.
Attachment #8527309 - Attachment is obsolete: true
Attachment #8527316 - Flags: review?(neil)
Attachment #8527316 - Flags: review?(neil) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.33
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: