[profview] Use identity operator
Use !== instead of !=. Bug: Change-Id: I3f8127d54b80973f9ea7bb6ddf25afd928cb3045 Reviewed-on: https://chromium-review.googlesource.com/753733 Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Commit-Queue: Franziska Hinkelmann <franzih@chromium.org> Cr-Commit-Position: refs/heads/master@{#49210}
This commit is contained in:
parent
ba76ad68e3
commit
022b2d499a
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
"use strict"
|
||||
"use strict";
|
||||
|
||||
let codeKinds = [
|
||||
"UNKNOWN",
|
||||
@ -80,13 +80,13 @@ function resolveCodeKindAndVmState(code, vmState) {
|
||||
|
||||
function codeEquals(code1, code2, allowDifferentKinds = false) {
|
||||
if (!code1 || !code2) return false;
|
||||
if (code1.name != code2.name || code1.type != code2.type) return false;
|
||||
if (code1.name !== code2.name || code1.type !== code2.type) return false;
|
||||
|
||||
if (code1.type == 'CODE') {
|
||||
if (!allowDifferentKinds && code1.kind != code2.kind) return false;
|
||||
} else if (code1.type == 'JS') {
|
||||
if (!allowDifferentKinds && code1.kind != code2.kind) return false;
|
||||
if (code1.func != code2.func) return false;
|
||||
if (code1.type === 'CODE') {
|
||||
if (!allowDifferentKinds && code1.kind !== code2.kind) return false;
|
||||
} else if (code1.type === 'JS') {
|
||||
if (!allowDifferentKinds && code1.kind !== code2.kind) return false;
|
||||
if (code1.func !== code2.func) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -409,7 +409,7 @@ class CategorySampler {
|
||||
let { tm : timestamp, vm : vmState, s : stack } = file.ticks[tickIndex];
|
||||
|
||||
let i = Math.floor((timestamp - this.firstTime) / this.step);
|
||||
if (i == this.buckets.length) i--;
|
||||
if (i === this.buckets.length) i--;
|
||||
console.assert(i >= 0 && i < this.buckets.length);
|
||||
|
||||
let bucket = this.buckets[i];
|
||||
@ -440,7 +440,7 @@ class FunctionTimelineProcessor {
|
||||
// ignoring any filtered entries.
|
||||
let stackCode = undefined;
|
||||
let functionPosInStack = -1;
|
||||
let filteredI = 0
|
||||
let filteredI = 0;
|
||||
for (let i = 0; i < stack.length - 1; i += 2) {
|
||||
let codeId = stack[i];
|
||||
let code = codeId >= 0 ? file.code[codeId] : undefined;
|
||||
@ -461,7 +461,7 @@ class FunctionTimelineProcessor {
|
||||
if (functionPosInStack >= 0) {
|
||||
let stackKind = resolveCodeKindAndVmState(stackCode, vmState);
|
||||
|
||||
let codeIsTopOfStack = (functionPosInStack == 0);
|
||||
let codeIsTopOfStack = (functionPosInStack === 0);
|
||||
|
||||
if (this.currentBlock !== null) {
|
||||
this.currentBlock.end = timestamp;
|
||||
|
@ -49,7 +49,7 @@ let main = {
|
||||
currentState : emptyState(),
|
||||
|
||||
setMode(mode) {
|
||||
if (mode != main.currentState.mode) {
|
||||
if (mode !== main.currentState.mode) {
|
||||
|
||||
function setCallTreeModifiers(attribution, categories, sort) {
|
||||
let callTreeState = Object.assign({}, main.currentState.callTree);
|
||||
@ -84,7 +84,7 @@ let main = {
|
||||
},
|
||||
|
||||
setCallTreeAttribution(attribution) {
|
||||
if (attribution != main.currentState.attribution) {
|
||||
if (attribution !== main.currentState.attribution) {
|
||||
let callTreeState = Object.assign({}, main.currentState.callTree);
|
||||
callTreeState.attribution = attribution;
|
||||
main.currentState = setCallTreeState(main.currentState, callTreeState);
|
||||
@ -93,7 +93,7 @@ let main = {
|
||||
},
|
||||
|
||||
setCallTreeSort(sort) {
|
||||
if (sort != main.currentState.sort) {
|
||||
if (sort !== main.currentState.sort) {
|
||||
let callTreeState = Object.assign({}, main.currentState.callTree);
|
||||
callTreeState.sort = sort;
|
||||
main.currentState = setCallTreeState(main.currentState, callTreeState);
|
||||
@ -102,7 +102,7 @@ let main = {
|
||||
},
|
||||
|
||||
setCallTreeCategories(categories) {
|
||||
if (categories != main.currentState.categories) {
|
||||
if (categories !== main.currentState.categories) {
|
||||
let callTreeState = Object.assign({}, main.currentState.callTree);
|
||||
callTreeState.categories = categories;
|
||||
main.currentState = setCallTreeState(main.currentState, callTreeState);
|
||||
@ -111,8 +111,8 @@ let main = {
|
||||
},
|
||||
|
||||
setViewInterval(start, end) {
|
||||
if (start != main.currentState.start ||
|
||||
end != main.currentState.end) {
|
||||
if (start !== main.currentState.start ||
|
||||
end !== main.currentState.end) {
|
||||
main.currentState = Object.assign({}, main.currentState);
|
||||
main.currentState.start = start;
|
||||
main.currentState.end = end;
|
||||
@ -121,8 +121,8 @@ let main = {
|
||||
},
|
||||
|
||||
setTimeLineDimensions(width, height) {
|
||||
if (width != main.currentState.timeLine.width ||
|
||||
height != main.currentState.timeLine.height) {
|
||||
if (width !== main.currentState.timeLine.width ||
|
||||
height !== main.currentState.timeLine.height) {
|
||||
let timeLine = Object.assign({}, main.currentState.timeLine);
|
||||
timeLine.width = width;
|
||||
timeLine.height = height;
|
||||
@ -133,7 +133,7 @@ let main = {
|
||||
},
|
||||
|
||||
setFile(file) {
|
||||
if (file != main.currentState.file) {
|
||||
if (file !== main.currentState.file) {
|
||||
main.currentState = Object.assign({}, main.currentState);
|
||||
main.currentState.file = file;
|
||||
main.delayRender();
|
||||
@ -141,7 +141,7 @@ let main = {
|
||||
},
|
||||
|
||||
setCurrentCode(codeId) {
|
||||
if (codeId != main.currentState.currentCodeId) {
|
||||
if (codeId !== main.currentState.currentCodeId) {
|
||||
main.currentState = Object.assign({}, main.currentState);
|
||||
main.currentState.currentCodeId = codeId;
|
||||
main.delayRender();
|
||||
@ -235,7 +235,7 @@ let bucketDescriptors =
|
||||
text : "Unknown" }
|
||||
];
|
||||
|
||||
let kindToBucketDescriptor = {}
|
||||
let kindToBucketDescriptor = {};
|
||||
for (let i = 0; i < bucketDescriptors.length; i++) {
|
||||
let bucket = bucketDescriptors[i];
|
||||
for (let j = 0; j < bucket.kinds.length; j++) {
|
||||
@ -335,11 +335,11 @@ function createTableExpander(indent) {
|
||||
}
|
||||
|
||||
function createFunctionNode(name, codeId) {
|
||||
if (codeId == -1) {
|
||||
if (codeId === -1) {
|
||||
return document.createTextNode(name);
|
||||
}
|
||||
let nameElement = document.createElement("span");
|
||||
nameElement.classList.add("codeid-link")
|
||||
nameElement.classList.add("codeid-link");
|
||||
nameElement.onclick = function() {
|
||||
main.setCurrentCode(codeId);
|
||||
};
|
||||
@ -377,13 +377,13 @@ class CallTreeView {
|
||||
if (c1.ticks < c2.ticks) return 1;
|
||||
else if (c1.ticks > c2.ticks) return -1;
|
||||
return c2.ownTicks - c1.ownTicks;
|
||||
}
|
||||
};
|
||||
case "own-time":
|
||||
return (c1, c2) => {
|
||||
if (c1.ownTicks < c2.ownTicks) return 1;
|
||||
else if (c1.ownTicks > c2.ownTicks) return -1;
|
||||
return c2.ticks - c1.ticks;
|
||||
}
|
||||
};
|
||||
case "category-time":
|
||||
return (c1, c2) => {
|
||||
if (c1.type === c2.type) return c2.ticks - c1.ticks;
|
||||
@ -439,7 +439,7 @@ class CallTreeView {
|
||||
let row = this.rows.insertRow(index);
|
||||
row.id = id + i + "/";
|
||||
|
||||
if (node.type != "CAT") {
|
||||
if (node.type !== "CAT") {
|
||||
row.style.backgroundColor = bucketFromKind(node.type).backgroundColor;
|
||||
}
|
||||
|
||||
@ -631,7 +631,7 @@ class CallTreeView {
|
||||
|
||||
} else {
|
||||
console.assert(mode === "bottom-up");
|
||||
if (this.currentState.callTree.categories == "none") {
|
||||
if (this.currentState.callTree.categories === "none") {
|
||||
stackProcessor =
|
||||
new PlainCallTreeProcessor(filter, true);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user