Title: [222599] trunk/Source/WebInspectorUI
- Revision
- 222599
- Author
- [email protected]
- Date
- 2017-09-27 21:20:05 -0700 (Wed, 27 Sep 2017)
Log Message
Uncaught Exception: Attempted to assign to readonly property (at ContentView.js:206:34)
https://bugs.webkit.org/show_bug.cgi?id=177587
Patch by Joseph Pecoraro <[email protected]> on 2017-09-27
Reviewed by Matt Baker.
We allow a representedObject to be a string. In strict mode attempting to set
a property on a string results in a TypeError. So we should be careful not to
do this in the rare cases where our representedObject is the a string.
* UserInterface/Views/ContentView.js:
(WI.ContentView.contentViewForRepresentedObject):
(WI.ContentView.closedContentViewForRepresentedObject):
Avoid setting a property on strings. ContentViews backed by a String aren't typically
shared anyways, so the property case would not be useful. If a client really wants
to share they could use `new String(...)` as the representedObject.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (222598 => 222599)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-09-28 04:19:13 UTC (rev 222598)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-09-28 04:20:05 UTC (rev 222599)
@@ -1,3 +1,21 @@
+2017-09-27 Joseph Pecoraro <[email protected]>
+
+ Uncaught Exception: Attempted to assign to readonly property (at ContentView.js:206:34)
+ https://bugs.webkit.org/show_bug.cgi?id=177587
+
+ Reviewed by Matt Baker.
+
+ We allow a representedObject to be a string. In strict mode attempting to set
+ a property on a string results in a TypeError. So we should be careful not to
+ do this in the rare cases where our representedObject is the a string.
+
+ * UserInterface/Views/ContentView.js:
+ (WI.ContentView.contentViewForRepresentedObject):
+ (WI.ContentView.closedContentViewForRepresentedObject):
+ Avoid setting a property on strings. ContentViews backed by a String aren't typically
+ shared anyways, so the property case would not be useful. If a client really wants
+ to share they could use `new String(...)` as the representedObject.
+
2017-09-27 Matt Baker <[email protected]>
Web Inspector: Missing checks in DebuggerSidebarPanel for DOM debugging support
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js (222598 => 222599)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js 2017-09-28 04:19:13 UTC (rev 222598)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js 2017-09-28 04:20:05 UTC (rev 222599)
@@ -199,7 +199,8 @@
return null;
console.assert(newContentView.representedObject === resolvedRepresentedObject, "createFromRepresentedObject and resolvedRepresentedObjectForRepresentedObject are out of sync for type", representedObject.constructor.name);
- newContentView.representedObject[WI.ContentView.ContentViewForRepresentedObjectSymbol] = newContentView;
+ if (typeof resolvedRepresentedObject === "object")
+ newContentView.representedObject[WI.ContentView.ContentViewForRepresentedObjectSymbol] = newContentView;
return newContentView;
}
@@ -206,7 +207,8 @@
static closedContentViewForRepresentedObject(representedObject)
{
let resolvedRepresentedObject = WI.ContentView.resolvedRepresentedObjectForRepresentedObject(representedObject);
- resolvedRepresentedObject[WI.ContentView.ContentViewForRepresentedObjectSymbol] = null;
+ if (typeof resolvedRepresentedObject === "object")
+ resolvedRepresentedObject[WI.ContentView.ContentViewForRepresentedObjectSymbol] = null;
}
static resolvedRepresentedObjectForRepresentedObject(representedObject)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes