Skip to content

Commit

Permalink
Merge r173805 - Web Inspector: fix TypeSet hierarchy in TypeTokenView
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=136982

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

TypeSet was computing the set of type booleans in the Inspector::Protocol::Runtime::TypeSet
object incorrectly because it was calling TypeSet::doesTypeConformTo(T) which checks if the
type set has only been of type T. It now checks '(m_seenTypes & T) != TypeNothing' to see
if type T is in the set of seen types, but not the entire set itself.

* runtime/TypeSet.cpp:
(JSC::TypeSet::inspectorTypeSet):

Source/WebInspectorUI:

The protocol object representation of TypeSet was being computed
incorrectly in JSC::TypeSet. This patch fixes that problem
and also asserts that the type information that the Web Inspector
receives is not empty.

* UserInterface/Models/TypeSet.js:
(WebInspector.TypeSet):
* UserInterface/Views/TypeTokenView.js:
(WebInspector.TypeTokenView.prototype._displayTypeName):

Canonical link: https://commits.webkit.org/154760.88@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@174938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
saambarati authored and carlosgcampos committed Oct 21, 2014
1 parent 98c4022 commit 195d408
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 10 deletions.
15 changes: 15 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,18 @@
2014-09-21 Saam Barati <saambarati1@gmail.com>

Web Inspector: fix TypeSet hierarchy in TypeTokenView
https://bugs.webkit.org/show_bug.cgi?id=136982

Reviewed by Joseph Pecoraro.

TypeSet was computing the set of type booleans in the Inspector::Protocol::Runtime::TypeSet
object incorrectly because it was calling TypeSet::doesTypeConformTo(T) which checks if the
type set has only been of type T. It now checks '(m_seenTypes & T) != TypeNothing' to see
if type T is in the set of seen types, but not the entire set itself.

* runtime/TypeSet.cpp:
(JSC::TypeSet::inspectorTypeSet):

2014-10-20 Mark Lam <mark.lam@apple.com>

[Follow up] Web Process crash when starting the web inspector after r174025.
Expand Down
16 changes: 8 additions & 8 deletions Source/JavaScriptCore/runtime/TypeSet.cpp
Expand Up @@ -269,14 +269,14 @@ PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::StructureDes
PassRefPtr<Inspector::Protocol::Runtime::TypeSet> TypeSet::inspectorTypeSet() const
{
return Inspector::Protocol::Runtime::TypeSet::create()
.setIsFunction(doesTypeConformTo(TypeFunction))
.setIsUndefined(doesTypeConformTo(TypeUndefined))
.setIsNull(doesTypeConformTo(TypeNull))
.setIsBoolean(doesTypeConformTo(TypeBoolean))
.setIsInteger(doesTypeConformTo(TypeMachineInt))
.setIsNumber(doesTypeConformTo(TypeNumber))
.setIsString(doesTypeConformTo(TypeString))
.setIsObject(doesTypeConformTo(TypeObject))
.setIsFunction((m_seenTypes & TypeFunction) != TypeNothing)
.setIsUndefined((m_seenTypes & TypeUndefined) != TypeNothing)
.setIsNull((m_seenTypes & TypeNull) != TypeNothing)
.setIsBoolean((m_seenTypes & TypeBoolean) != TypeNothing)
.setIsInteger((m_seenTypes & TypeMachineInt) != TypeNothing)
.setIsNumber((m_seenTypes & TypeNumber) != TypeNothing)
.setIsString((m_seenTypes & TypeString) != TypeNothing)
.setIsObject((m_seenTypes & TypeObject) != TypeNothing)
.release();
}
#endif
Expand Down
17 changes: 17 additions & 0 deletions Source/WebInspectorUI/ChangeLog
@@ -1,3 +1,20 @@
2014-09-21 Saam Barati <saambarati1@gmail.com>

Web Inspector: fix TypeSet hierarchy in TypeTokenView
https://bugs.webkit.org/show_bug.cgi?id=136982

Reviewed by Joseph Pecoraro.

The protocol object representation of TypeSet was being computed
incorrectly in JSC::TypeSet. This patch fixes that problem
and also asserts that the type information that the Web Inspector
receives is not empty.

* UserInterface/Models/TypeSet.js:
(WebInspector.TypeSet):
* UserInterface/Views/TypeTokenView.js:
(WebInspector.TypeTokenView.prototype._displayTypeName):

2014-10-21 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Test TestWebKitAPI/WebKit2Gtk/TestInspectorServer fails
Expand Down
1 change: 1 addition & 0 deletions Source/WebInspectorUI/UserInterface/Models/TypeSet.js
Expand Up @@ -47,6 +47,7 @@ WebInspector.TypeSet = function(runtimeTypeDescriptionPayload)
if (typeSet.isObject)
bitString |= WebInspector.TypeSet.TypeBit.Object;

console.assert(bitString);
this._bitString = bitString;
};

Expand Down
4 changes: 2 additions & 2 deletions Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js
Expand Up @@ -138,11 +138,11 @@ WebInspector.TypeTokenView.prototype = {
return false;
},

_displayTypeName: function()
_displayTypeName: function()
{
var typeSet = WebInspector.TypeSet.fromPayload(this._types);

if (this._types.leastCommonAncestor) {
if (this._types.leastCommonAncestor && !(this._types.primitiveTypeNames && this._types.primitiveTypeNames.length)) {
if (typeSet.isContainedIn(WebInspector.TypeSet.TypeBit.Object))
return this._types.leastCommonAncestor;
if (typeSet.isContainedIn(WebInspector.TypeSet.TypeBit.Object | WebInspector.TypeSet.NullOrUndefinedTypeBits))
Expand Down

0 comments on commit 195d408

Please sign in to comment.