Commit d35aaf74 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[tools] Avoid 'void 0' in modules

Bug: v8:10644
Change-Id: I24229cbbf6a3ffea0fd4c3b96ef6eaf1e780b6e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565136
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71505}
parent bec9f6c0
...@@ -40,7 +40,7 @@ function BYTES(bytes, total) { ...@@ -40,7 +40,7 @@ function BYTES(bytes, total) {
unitIndex++; unitIndex++;
} }
let result = formatNumber(value).padStart(10) + ' ' + units[unitIndex]; let result = formatNumber(value).padStart(10) + ' ' + units[unitIndex];
if (total !== void 0 && total != 0) { if (total !== undefined && total != 0) {
result += PERCENT(bytes, total).padStart(5); result += PERCENT(bytes, total).padStart(5);
} }
return result; return result;
...@@ -161,7 +161,7 @@ class CompilationUnit { ...@@ -161,7 +161,7 @@ class CompilationUnit {
class Script extends CompilationUnit { class Script extends CompilationUnit {
constructor(id) { constructor(id) {
super(); super();
if (id === void 0 || id <= 0) { if (id === undefined || id <= 0) {
throw new Error(`Invalid id=${id} for script`); throw new Error(`Invalid id=${id} for script`);
} }
this.file = ''; this.file = '';
...@@ -214,7 +214,7 @@ class Script extends CompilationUnit { ...@@ -214,7 +214,7 @@ class Script extends CompilationUnit {
addMissingFunktions(list) { addMissingFunktions(list) {
if (this.finalized) throw 'script is finalized!'; if (this.finalized) throw 'script is finalized!';
list.forEach(fn => { list.forEach(fn => {
if (this.funktions[fn.start] === void 0) { if (this.funktions[fn.start] === undefined) {
this.addFunktion(fn); this.addFunktion(fn);
} }
}); });
...@@ -222,8 +222,8 @@ class Script extends CompilationUnit { ...@@ -222,8 +222,8 @@ class Script extends CompilationUnit {
addFunktion(fn) { addFunktion(fn) {
if (this.finalized) throw 'script is finalized!'; if (this.finalized) throw 'script is finalized!';
if (fn.start === void 0) throw "Funktion has no start position"; if (fn.start === undefined) throw "Funktion has no start position";
if (this.funktions[fn.start] !== void 0) { if (this.funktions[fn.start] !== undefined) {
fn.print(); fn.print();
throw "adding same function twice to script"; throw "adding same function twice to script";
} }
...@@ -441,7 +441,7 @@ class Script extends CompilationUnit { ...@@ -441,7 +441,7 @@ class Script extends CompilationUnit {
for (let i = 1; i < metricProperties.length; i += kMetricIncrement) { for (let i = 1; i < metricProperties.length; i += kMetricIncrement) {
let timestampPropertyName = metricProperties[i]; let timestampPropertyName = metricProperties[i];
let timestamp = funktionOrScript[timestampPropertyName]; let timestamp = funktionOrScript[timestampPropertyName];
if (timestamp === void 0) continue; if (timestamp === undefined) continue;
if (timestamp < start || end < timestamp) continue; if (timestamp < start || end < timestamp) continue;
timestamp -= start; timestamp -= start;
let index = Math.floor(timestamp / delta); let index = Math.floor(timestamp / delta);
...@@ -906,7 +906,7 @@ export class ParseProcessor extends LogReader { ...@@ -906,7 +906,7 @@ export class ParseProcessor extends LogReader {
} }
let script = this.lookupScript(scriptId); let script = this.lookupScript(scriptId);
let funktion = script.getFunktionAtStartPosition(startPosition); let funktion = script.getFunktionAtStartPosition(startPosition);
if (funktion === void 0) { if (funktion === undefined) {
funktion = new Funktion(functionName, startPosition, endPosition, script); funktion = new Funktion(functionName, startPosition, endPosition, script);
} }
return funktion; return funktion;
......
...@@ -24,4 +24,4 @@ export function formatSeconds(millis) { ...@@ -24,4 +24,4 @@ export function formatSeconds(millis) {
export function delay(time) { export function delay(time) {
return new Promise(resolver => setTimeout(resolver, time)); return new Promise(resolver => setTimeout(resolver, time));
} }
\ No newline at end of file
...@@ -20,4 +20,4 @@ export class LogEntry { ...@@ -20,4 +20,4 @@ export class LogEntry {
static get allTypes() { static get allTypes() {
throw new Error('Not implemented.'); throw new Error('Not implemented.');
} }
} }
\ No newline at end of file
...@@ -34,7 +34,7 @@ define(Array.prototype, 'last', function() { ...@@ -34,7 +34,7 @@ define(Array.prototype, 'last', function() {
// Map Log Events // Map Log Events
class MapLogEntry extends LogEntry { class MapLogEntry extends LogEntry {
edge = void 0; edge = undefined;
children = []; children = [];
depth = 0; depth = 0;
_isDeprecated = false; _isDeprecated = false;
...@@ -80,8 +80,7 @@ class MapLogEntry extends LogEntry { ...@@ -80,8 +80,7 @@ class MapLogEntry extends LogEntry {
} }
parent() { parent() {
if (this.edge === void 0) return void 0; return this.edge?.from;
return this.edge.from;
} }
isDeprecated() { isDeprecated() {
...@@ -93,7 +92,7 @@ class MapLogEntry extends LogEntry { ...@@ -93,7 +92,7 @@ class MapLogEntry extends LogEntry {
} }
isRoot() { isRoot() {
return this.edge === void 0 || this.edge.from === void 0; return this.edge === undefined || this.edge.from === undefined;
} }
contains(map) { contains(map) {
...@@ -136,11 +135,11 @@ class MapLogEntry extends LogEntry { ...@@ -136,11 +135,11 @@ class MapLogEntry extends LogEntry {
} }
get type() { get type() {
return this.edge === void 0 ? 'new' : this.edge.type; return this.edge === undefined ? 'new' : this.edge.type;
} }
isBootstrapped() { isBootstrapped() {
return this.edge === void 0; return this.edge === undefined;
} }
getParents() { getParents() {
......
...@@ -69,4 +69,4 @@ export class ToolTipEvent extends CustomEvent { ...@@ -69,4 +69,4 @@ export class ToolTipEvent extends CustomEvent {
get positionOrTargetNode() { get positionOrTargetNode() {
return this._positionOrTargetNode; return this._positionOrTargetNode;
} }
} }
\ No newline at end of file
...@@ -87,7 +87,7 @@ DOM.defineCustomElement( ...@@ -87,7 +87,7 @@ DOM.defineCustomElement(
} }
_addMapAndParentTransitions(map) { _addMapAndParentTransitions(map) {
if (map === void 0) return; if (map === undefined) return;
if (this._displayedMapsInTree.has(map)) return; if (this._displayedMapsInTree.has(map)) return;
this._displayedMapsInTree.add(map); this._displayedMapsInTree.add(map);
this.currentNode = this.transitionView; this.currentNode = this.transitionView;
...@@ -191,7 +191,7 @@ DOM.defineCustomElement( ...@@ -191,7 +191,7 @@ DOM.defineCustomElement(
// Add subtransitions except the one that's already shown. // Add subtransitions except the one that's already shown.
let visibleTransitionMap = subtransitionNodes.length == 1 ? let visibleTransitionMap = subtransitionNodes.length == 1 ?
transitionsNode.querySelector('.map').map : transitionsNode.querySelector('.map').map :
void 0; undefined;
map.children.forEach((edge) => { map.children.forEach((edge) => {
if (edge.to != visibleTransitionMap) { if (edge.to != visibleTransitionMap) {
this.currentNode = transitionsNode; this.currentNode = transitionsNode;
......
...@@ -249,4 +249,4 @@ class LineBuilder { ...@@ -249,4 +249,4 @@ class LineBuilder {
marker.onmouseover = this._mouseoverHandler; marker.onmouseover = this._mouseoverHandler;
return marker; return marker;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment