WebInspector: Can't open a new tab: Uncaught Exception: TypeError: this.isNewTabWithT...
authornvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Dec 2015 06:07:23 +0000 (06:07 +0000)
committernvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Dec 2015 06:07:23 +0000 (06:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152471

Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector._updateNewTabButtonState):
Don't use arrow functions because of https://webkit.org/b/152497 "Arrow functions: 'this' isn't lexically bound"

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194360 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js

index eed5423..01e86b9 100644 (file)
@@ -1,5 +1,16 @@
 2015-12-21  Nikita Vasilyev  <nvasilyev@apple.com>
 
+        WebInspector: Can't open a new tab: Uncaught Exception: TypeError: this.isNewTabWithTypeAllowed is not a function
+        https://bugs.webkit.org/show_bug.cgi?id=152471
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector._updateNewTabButtonState):
+        Don't use arrow functions because of https://webkit.org/b/152497 "Arrow functions: 'this' isn't lexically bound"
+
+2015-12-21  Nikita Vasilyev  <nvasilyev@apple.com>
+
         Web Inspector: Remove unused WebInspector.Object.removeAllListeners
         https://bugs.webkit.org/show_bug.cgi?id=152474
 
index 9e4ae0b..e0aa5e3 100644 (file)
@@ -490,7 +490,11 @@ WebInspector._updateNewTabButtonState = function(event)
 {
     let allTabs = [...this._knownTabClassesByType.values()];
     let addableTabs = allTabs.filter((tabClass) => !tabClass.isEphemeral());
-    let canMakeNewTab = addableTabs.some((tabClass) => this.isNewTabWithTypeAllowed(tabClass.Type));
+
+    // FIXME: Use arrow functions once http://webkit.org/b/152497 is resolved.
+    let canMakeNewTab = addableTabs.some(function(tabClass) {
+        return this.isNewTabWithTypeAllowed(tabClass.Type);
+    }.bind(this));
     this.tabBar.newTabItem.disabled = !canMakeNewTab;
 };