Web Inspector: ProfileNode cleanup
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2015 22:58:05 +0000 (22:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2015 22:58:05 +0000 (22:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146472

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-06-30
Reviewed by Timothy Hatcher.

* UserInterface/Models/ProfileNode.js:
(WebInspector.ProfileNode):
Use Array.prototype.every instead of reduce.
Correct the name of a function to be what callers expect!

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/ProfileNode.js

index 4524c58..577d9c5 100644 (file)
@@ -1,5 +1,17 @@
 2015-06-30  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Web Inspector: ProfileNode cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=146472
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Models/ProfileNode.js:
+        (WebInspector.ProfileNode):
+        Use Array.prototype.every instead of reduce.
+        Correct the name of a function to be what callers expect!
+
+2015-06-30  Joseph Pecoraro  <pecoraro@apple.com>
+
         Web Inspector: iOS 8: Profile Nodes not showing in JavaScript Timeline
         https://bugs.webkit.org/show_bug.cgi?id=146471
 
index 87509c4..9cd8afa 100644 (file)
@@ -34,9 +34,9 @@ WebInspector.ProfileNode = class ProfileNode extends WebInspector.Object
         console.assert(id);
         console.assert(calls instanceof Array);
         console.assert(calls.length >= 1);
-        console.assert(calls.reduce(function(previousValue, call) { return previousValue && call instanceof WebInspector.ProfileNodeCall; }, true));
+        console.assert(calls.every(function(call) { return call instanceof WebInspector.ProfileNodeCall; }));
         console.assert(childNodes instanceof Array);
-        console.assert(childNodes.reduce(function(previousValue, node) { return previousValue && node instanceof WebInspector.ProfileNode; }, true));
+        console.assert(childNodes.every(function(node) { return node instanceof WebInspector.ProfileNode; }));
 
         this._id = id;
         this._type = type || WebInspector.ProfileNode.Type.Function;
@@ -207,7 +207,7 @@ WebInspector.ProfileNode = class ProfileNode extends WebInspector.Object
 
     // Private
 
-    _computeTotalTimes()
+    _computeTotalTimesIfNeeded()
     {
         if (this._computedTotalTimes)
             return;