From e6fea60b0c9abf47631f53b730ac9c7d59e57c17 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 9 Jan 2017 12:04:30 +0100 Subject: [PATCH] typo + comment --- src/helpers/util.js | 21 +++++++++++---------- src/trace/traceManager.js | 4 ++-- src/ui/ButtonNavigator.js | 4 ++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/helpers/util.js b/src/helpers/util.js index 2a84846cd4..60ee806f15 100644 --- a/src/helpers/util.js +++ b/src/helpers/util.js @@ -85,8 +85,16 @@ module.exports = { return index >= 0 ? array[index] : null }, + /** + * Find the call from @args rootCall which contains @args index (recursive) + * + * @param {Int} index - index of the vmtrace + * @param {Object} rootCall - call tree, built by the trace analyser + * @return {Object} - return the call which include the @args index + */ findCall: findCall, - buildCallsPath: buildCallsPath + + buildCallPath: buildCallPath } /** @@ -96,21 +104,14 @@ module.exports = { * @param {Object} rootCall - call tree, built by the trace analyser * @return {Array} - return the calls path to @args index */ -function buildCallsPath (index, rootCall) { +function buildCallPath (index, rootCall) { var ret = [] findCallInternal(index, rootCall, ret) return ret } -/** - * Find the call from @args rootCall which contains @args index (recursive) - * - * @param {Int} index - index of the vmtrace - * @param {Object} rootCall - call tree, built by the trace analyser - * @return {Object} - return the call which include the @args index - */ function findCall (index, rootCall) { - var ret = buildCallsPath(index, rootCall) + var ret = buildCallPath(index, rootCall) return ret[ret.length - 1] } diff --git a/src/trace/traceManager.js b/src/trace/traceManager.js index a8f323827b..8208844b70 100644 --- a/src/trace/traceManager.js +++ b/src/trace/traceManager.js @@ -114,12 +114,12 @@ TraceManager.prototype.getCallDataAt = function (stepIndex, callback) { callback(null, [this.traceCache.callsData[callDataChange]]) } -TraceManager.prototype.buildCallsPath = function (stepIndex, callback) { +TraceManager.prototype.buildCallPath = function (stepIndex, callback) { var check = this.checkRequestedStep(stepIndex) if (check) { return callback(check, null) } - var callsPath = util.buildCallsPath(stepIndex, this.traceCache.callsTree.call) + var callsPath = util.buildCallPath(stepIndex, this.traceCache.callsTree.call) if (callsPath === null) return callback('no call path built', null) callback(null, callsPath) } diff --git a/src/ui/ButtonNavigator.js b/src/ui/ButtonNavigator.js index 8b438d215e..161d82fb79 100644 --- a/src/ui/ButtonNavigator.js +++ b/src/ui/ButtonNavigator.js @@ -21,7 +21,7 @@ function ButtonNavigator (_parent, _traceManager) { if (index < 0) return if (_parent.currentStepIndex !== index) return - this.traceManager.buildCallsPath(index, (error, callsPath) => { + this.traceManager.buildCallPath(index, (error, callsPath) => { if (error) { console.log(error) resetWarning(this) @@ -66,7 +66,7 @@ ButtonNavigator.prototype.render = function () { +