085d7c68ba | ||
---|---|---|
.. | ||
dist | ||
.jshintrc | ||
.npmignore | ||
.nvmrc | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
bower.json | ||
gulpfile.js | ||
karma.conf.ci.js | ||
karma.conf.js | ||
package.json | ||
stackframe.js |
README.md
stackframe
JS Object representation of a stack frame
Underlies functionality of other modules within stacktrace.js.
Written to closely resemble StackFrame representations in Gecko and V8
Usage
// Create StackFrame and set properties
var stackFrame = new StackFrame('funName', ['args'], 'http://localhost:3000/file.js', 1, 3288, 'ORIGINAL_STACK_LINE');
stackFrame.functionName // => "funName"
stackFrame.setFunctionName('newName')
stackFrame.getFunctionName() // => "newName"
stackFrame.args // => ["args"]
stackFrame.setArgs([])
stackFrame.getArgs() // => []
stackFrame.fileName // => 'http://localhost:3000/file.min.js'
stackFrame.setFileName('http://localhost:3000/file.js')
stackFrame.getFileName() // => 'http://localhost:3000/file.js'
stackFrame.lineNumber // => 1
stackFrame.setLineNumber(325)
stackFrame.getLineNumber() // => 325
stackFrame.columnNumber // => 3288
stackFrame.setColumnNumber(20)
stackFrame.getColumnNumber() // => 20
stackFrame.source // => 'ORIGINAL_STACK_LINE'
stackFrame.setSource('NEW_SOURCE')
stackFrame.getSource() // => 'NEW_SOURCE'
stackFrame.toString() // => 'funName(args)@http://localhost:3000/file.js:325:20'
Installation
npm install stackframe
bower install stackframe
https://raw.githubusercontent.com/stacktracejs/stackframe/master/dist/stackframe.min.js