Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stack-trace-parser

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stack-trace-parser - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

4

example-undefined.js

@@ -10,7 +10,7 @@ var stackTraceParser = require('./src/parser')

assert(stackTrace.type === 'ReferenceError', "Expected stack trace type to be ReferenceError but instead it is " + stackTrace.type);
assert.strictEqual(stackTrace.message, 'd is not defined', "Expected stack trace message to be 'd is not defined' but instead it is: " + stackTrace.message);
assert(stackTrace[0].fileName.indexOf('example-undefined.js') !== -1, "Expected file name to contain 'example-undefined.js'!");
assert.strictEqual(stackTrace[0].lineNumber, 5, "Expected line number to match line 5 of this file not " + stackTrace[0].lineNumber);
assert.strictEqual(stackTrace[0].columnNumber, 7, "Expected column number to match column 7 of this file not " + stackTrace[0].columnNumber);
throw exception;
}

@@ -10,2 +10,4 @@ var stackTraceParser = require('./src/parser')

assert(stackTrace.type === 'Error', "Expected stack trace type to be Error but instead it is " + stackTrace.type);
assert.strictEqual(stackTrace.message, 'just got real', "Expected stack trace message to be 'just got real' but instead it is: " + stackTrace.message);
assert(stackTrace[0].fileName.indexOf('example.js') !== -1, "Expected file name to contain 'example.js'!");

@@ -12,0 +14,0 @@ assert.strictEqual(stackTrace[0].lineNumber, 5, "Expected line number to match line 5 of this file!");

{
"name": "stack-trace-parser",
"description": "parse stack trace",
"version": "0.0.3",
"version": "0.0.4",
"main": "src/parser.js",

@@ -6,0 +6,0 @@ "dependencies": {},

@@ -9,3 +9,3 @@ # stack-trace-parser [![Build Status](https://travis-ci.org/cymen/node-stack-trace-parser.png?branch=master)](https://travis-ci.org/cymen/node-stack-trace-parser)

### example (from `example.js`)
### example of Error exception (see `example.js`)

@@ -21,2 +21,4 @@ var stackTraceParser = require('./src/parser')

assert(stackTrace.type === 'Error', "Expected stack trace type to be Error but instead it is " + stackTrace.type);
assert.strictEqual(stackTrace.message, 'just got real', "Expected stack trace message to be 'just got real' but instead it is: " + stackTrace.message);
assert(stackTrace[0].fileName.indexOf('example.js') !== -1, "Expected file name to contain 'example.js'!");

@@ -26,1 +28,19 @@ assert.strictEqual(stackTrace[0].lineNumber, 5, "Expected line number to match line 5 of this file!");

}
### example of ReferenceError exception (see `example-undefined.js`)
var stackTraceParser = require('./src/parser')
assert = require('assert');
try {
d = d * 2;
}
catch (exception) {
var stackTrace = stackTraceParser.parse(exception);
assert(stackTrace.type === 'ReferenceError', "Expected stack trace type to be ReferenceError but instead it is " + stackTrace.type);
assert.strictEqual(stackTrace.message, 'd is not defined', "Expected stack trace message to be 'd is not defined' but instead it is: " + stackTrace.message);
assert(stackTrace[0].fileName.indexOf('example-undefined.js') !== -1, "Expected file name to contain 'example-undefined.js'!");
assert.strictEqual(stackTrace[0].lineNumber, 5, "Expected line number to match line 5 of this file not " + stackTrace[0].lineNumber);
assert.strictEqual(stackTrace[0].columnNumber, 7, "Expected column number to match column 7 of this file not " + stackTrace[0].columnNumber);
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc