Closed alexgimenez02 closed 1 year ago
When attempting to create a "flat" profile, I am presented with the following error:
Checking by myself, I noticed the conditional to check if the value is 0 or 1 is wrong.
Current implementation:
setGenerateType: function (type) { const types = [0, 1]; if (types.indexOf(type) > 0) { binding.cpu.setGenerateType(type); } else { console.error(`type should in [${types.join(', ')}], got ${type}.`); } },
My suggestion:
setGenerateType: function (type) { const types = [0, 1]; if (types.indexOf(type) > -1) { binding.cpu.setGenerateType(type); } else { console.error(`type should in [${types.join(', ')}], got ${type}.`); } },
landed at: https://github.com/hyj1991/v8-profiler-next/commit/a8ebd969c6c618af370aebfa7a6ada4d7c85e956
Thank you for your feedback :)
When attempting to create a "flat" profile, I am presented with the following error:
Checking by myself, I noticed the conditional to check if the value is 0 or 1 is wrong.
Current implementation:
My suggestion: