Bug 152471

Summary: WebInspector: Can't open a new tab: Uncaught Exception: TypeError: this.isNewTabWithTypeAllowed is not a function
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=152497
Attachments:
Description Flags
[Image] Exception
none
Patch
none
Patch
timothy: review+
Patch none

Nikita Vasilyev
Reported 2015-12-20 21:07:37 PST
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)
Attachments
[Image] Exception (218.19 KB, image/png)
2015-12-20 21:20 PST, Nikita Vasilyev
no flags
Patch (1.48 KB, patch)
2015-12-20 21:46 PST, Nikita Vasilyev
no flags
Patch (1.49 KB, patch)
2015-12-20 21:50 PST, Nikita Vasilyev
timothy: review+
Patch (1.70 KB, patch)
2015-12-21 21:08 PST, Nikita Vasilyev
no flags
Nikita Vasilyev
Comment 1 2015-12-20 21:20:50 PST
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.
Nikita Vasilyev
Comment 2 2015-12-20 21:33:15 PST
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
Nikita Vasilyev
Comment 3 2015-12-20 21:39:41 PST
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)
Nikita Vasilyev
Comment 4 2015-12-20 21:46:47 PST
Nikita Vasilyev
Comment 5 2015-12-20 21:50:27 PST
Timothy Hatcher
Comment 6 2015-12-21 16:57:44 PST
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.
Blaze Burg
Comment 7 2015-12-21 19:24:03 PST
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.
Nikita Vasilyev
Comment 8 2015-12-21 21:08:33 PST
WebKit Commit Bot
Comment 9 2015-12-21 22:07:47 PST
Comment on attachment 267779 [details] Patch Clearing flags on attachment: 267779 Committed r194360: <http://trac.webkit.org/changeset/194360>
WebKit Commit Bot
Comment 10 2015-12-21 22:07:51 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.