Clicking on "+" icon in the tab bar results in this exception. Loading completed: true Uncaught exceptions: - TypeError: this.isNewTabWithTypeAllowed is not a function. (In 'this.isNewTabWithTypeAllowed(tabClass.Type)', 'this.isNewTabWithTypeAllowed' is undefined) (at Main.js:494:84)
Created attachment 267732 [details] [Image] Exception I no longer understand what's going on — an exception is thrown because this.isNewTabWithTypeAllowed is not a function, yet, hovering over it shows that it is clearly a function.
This happens when WebInspector._updateNewTabButtonState gets called from listenersForThisEvent[i].listener.call(listenersForThisEvent[i].thisObject, event); https://github.com/WebKit/webkit/blob/7d256676418078205157678bf382fbdea88bc9bd/Source/WebInspectorUI/UserInterface/Base/Object.js#L155
Stacktrace: (anonymous function) (Main.js:496) some _updateNewTabButtonState (Main.js:494) dispatch (Object.js:155) dispatchEventToListeners (Object.js:162) insertTabBarItem (TabBar.js:181) addTabBarItem (TabBar.js:85) addTabForContentView (TabBrowser.js:148) tabContentViewForRepresentedObject (Main.js:1031) showRepresentedObject (Main.js:1038) showConsoleTab (Main.js:856) _consoleItemWasClicked (DefaultDashboardView.js:145) _consoleItemWasClicked _itemWasClicked (DefaultDashboardView.js:125) (anonymous function) (DefaultDashboardView.js:114)
Created attachment 267734 [details] Patch
Created attachment 267735 [details] Patch
Comment on attachment 267735 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=267735&action=review > Source/WebInspectorUI/UserInterface/Base/Main.js:494 > - let canMakeNewTab = addableTabs.some((tabClass) => this.isNewTabWithTypeAllowed(tabClass.Type)); > + let canMakeNewTab = addableTabs.some((tabClass) => WebInspector.isNewTabWithTypeAllowed(tabClass.Type)); this should work here but it is a bug in JSC right now that lexical bound this is not working in arrow functions. I'd vote for converting this to a bound anon function instead.
Comment on attachment 267735 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=267735&action=review >> Source/WebInspectorUI/UserInterface/Base/Main.js:494 >> + let canMakeNewTab = addableTabs.some((tabClass) => WebInspector.isNewTabWithTypeAllowed(tabClass.Type)); > > this should work here but it is a bug in JSC right now that lexical bound this is not working in arrow functions. I'd vote for converting this to a bound anon function instead. Please add a fixme with the bugzilla for the JSC fix as well.
Created attachment 267779 [details] Patch
Comment on attachment 267779 [details] Patch Clearing flags on attachment: 267779 Committed r194360: <http://trac.webkit.org/changeset/194360>
All reviewed patches have been landed. Closing bug.