Rob--W / browser-action-jplib

Jetpack module to add a Browser action badge to the toolbar, using the chrome.browserAction syntax from Chromium
21 stars 9 forks source link

Firefox 35 compatibility: "let foo" should precede function calls that use foo #15

Closed chatziko closed 9 years ago

chatziko commented 9 years ago

Firefox 35 implements ES6's "temporal dead zone" making it invalid to access a let variable before its initialization. Hence "let foo" shoulde precede any calls to inner functions that use "foo".

Without the fix the module fails under Firefox 35 with the error: ReferenceError: can't access let declaration `widgetViews' before initialization

The fix is trivial, just move "let widgetViews" a bit higher up (before the setPanelPlaceholder call).

Rob--W commented 9 years ago

Looks good, thanks!