Commit 2db6ff85 authored by Iuri Matias's avatar Iuri Matias Committed by aniket-engg

refactor checkRequestedStep

parent d1dc0819
...@@ -112,9 +112,9 @@ TraceManager.prototype.buildCallPath = function (stepIndex, callback) { ...@@ -112,9 +112,9 @@ TraceManager.prototype.buildCallPath = function (stepIndex, callback) {
} }
TraceManager.prototype.getCallStackAt = function (stepIndex) { TraceManager.prototype.getCallStackAt = function (stepIndex) {
// this.checkRequestedStep(stepIndex) try {
const check = this.checkRequestedStep(stepIndex) this.checkRequestedStep(stepIndex)
if (check) { } catch (check) {
throw new Error(check) throw new Error(check)
} }
const call = util.findCall(stepIndex, this.traceCache.callsTree.call) const call = util.findCall(stepIndex, this.traceCache.callsTree.call)
...@@ -154,9 +154,9 @@ TraceManager.prototype.getStackAt = function (stepIndex, callback) { ...@@ -154,9 +154,9 @@ TraceManager.prototype.getStackAt = function (stepIndex, callback) {
// } // }
TraceManager.prototype.getLastCallChangeSince = function (stepIndex) { TraceManager.prototype.getLastCallChangeSince = function (stepIndex) {
// this.checkRequestedStep(stepIndex) try {
const check = this.checkRequestedStep(stepIndex) this.checkRequestedStep(stepIndex)
if (check) { } catch (check) {
// return callback(check, null) // return callback(check, null)
throw new Error(check) throw new Error(check)
} }
...@@ -204,8 +204,9 @@ TraceManager.prototype.getLastCallChangeSince = function (stepIndex) { ...@@ -204,8 +204,9 @@ TraceManager.prototype.getLastCallChangeSince = function (stepIndex) {
// } // }
TraceManager.prototype.getCurrentCalledAddressAt = function (stepIndex, callback) { TraceManager.prototype.getCurrentCalledAddressAt = function (stepIndex, callback) {
const check = this.checkRequestedStep(stepIndex) try {
if (check) { this.checkRequestedStep(stepIndex)
} catch (check) {
return callback(check, null) return callback(check, null)
} }
......
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