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

tracekit

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tracekit - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

.editorconfig

41

Gruntfile.js

@@ -5,3 +5,2 @@ /*global module:false*/

// Project configuration.
grunt.initConfig({

@@ -15,3 +14,3 @@ 'closureCompiler': {

warning_level: 'verbose',
jscomp_off: ['checkTypes', 'fileoverviewTags'],
jscomp_off: ['checkTypes', 'checkVars', 'fileoverviewTags'],
summary_detail_level: 3,

@@ -23,3 +22,2 @@ output_wrapper: '"(function(){%output%}).call(this);"'

}
},

@@ -33,35 +31,9 @@ 'compile': {

options: {
// Uncommented are default grunt options
bitwise: true, //Added from site
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
noempty: true, //Added from site
nonew: true, //Added
quotmark: 'single', //Added
/* regexp: true, */
undef: true,
unused: true, //Added from site
/* strict: true, //Added from site */
sub: true,
boss: true, //dont' allow assignments to be evaluated as truthy/falsey */
eqnull: true, //Allow == null
browser: true,
/* indent: 4, //Added from site */
devel: true, //Added
white: false,
onecase: true,
trailing: true,
maxparams: 6,
maxdepth: 9,
maxerr: 20
jshintrc: '.jshintrc'
},
globals: {
ActiveXObject: false
},
lint: {
src: ['grunt.js', 'tracekit.js']
src: [
'grunt.js',
'tracekit.js'
]
}

@@ -75,3 +47,2 @@ }

grunt.registerTask('default', ['jshint:lint', 'closureCompiler:compile']);
grunt.registerTask('travis', ['jshint:lint', 'closureCompiler:compile']);
};
{
"name": "tracekit",
"version": "0.1.0",
"main": "./tracekit.js",
"version": "0.2.0",
"homepage": "https://github.com/csnover/TraceKit",
"description": "Cross browser stack traces",
"repository": {
"type": "git",
"url": "https://github.com/defunctzombie/TraceKit.git"
"url": "https://github.com/csnover/TraceKit.git"
},
"bugs": {
"url": "https://github.com/csnover/TraceKit/issues"
},
"keywords": [
"TraceKit",
"stack traces"
],
"license": "MIT",
"devDependencies": {
"zuul": "~1.0.9"
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.11.2",
"grunt-cli": "~0.1.13",
"grunt-closure-tools": "~0.9.8"
},
"scripts": {
"test": "zuul -- tests/index.js"
"test": "grunt --verbose travis"
}
}

@@ -81,4 +81,2 @@ TraceKit - Cross browser stack traces.

Right now the project is being over-hauled, please jump into #shieldjs on freenode to discuss before submitting a big/medium PR (this saves us all time)
All code must pass JSHint and tests, run `grunt` for this. New features need accompanying documentation in the README, changes to existing api's need updated documentation. In general, open an issue for whatever it is you're thinking, get some quick feedback, make good stuff, and we'll accept the PR.

@@ -85,0 +83,0 @@

/*
TraceKit - Cross brower stack traces - github.com/occ/TraceKit
TraceKit - Cross brower stack traces - github.com/csnover/TraceKit
MIT license
*/
(function(window, undefined) {
if (!window) {
return;
}
var TraceKit = {};

@@ -18,3 +23,3 @@ var _oldTraceKit = window.TraceKit;

*
* @param {Object} host object to check property
* @param {Object} object to check property
* @param {string} key to check

@@ -127,5 +132,5 @@ */

*/
function notifyHandlers(stack, windowError) {
function notifyHandlers(stack, isWindowError) {
var exception = null;
if (windowError && !TraceKit.collectWindowErrors) {
if (isWindowError && !TraceKit.collectWindowErrors) {
return;

@@ -157,26 +162,36 @@ }

* occurred.
* @param {?(number|string)} columnNo The column number at which the error
* occurred.
* @param {?Error} errorObj The actual Error object.
*/
function traceKitWindowOnError(message, url, lineNo) {
function traceKitWindowOnError(message, url, lineNo, columnNo, errorObj) {
var stack = null;
if (lastExceptionStack) {
TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);
stack = lastExceptionStack;
lastExceptionStack = null;
lastException = null;
} else {
var location = {
'url': url,
'line': lineNo
};
location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line);
location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line);
stack = {
'mode': 'onerror',
'message': message,
'url': document.location.href,
'stack': [location],
'useragent': navigator.userAgent
};
if (errorObj) {
stack = TraceKit.computeStackTrace(errorObj);
}
else
{
if (lastExceptionStack) {
TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);
stack = lastExceptionStack;
lastExceptionStack = null;
lastException = null;
} else {
var location = {
'url': url,
'line': lineNo,
'column': columnNo
};
location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line);
location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line);
stack = {
'mode': 'onerror',
'message': message,
'url': document.location.href,
'stack': [location],
'useragent': navigator.userAgent
};
}
}

@@ -349,2 +364,6 @@ notifyHandlers(stack, 'from window.onerror');

function getSource(url) {
if (typeof url !== 'string') {
return [];
}
if (!_has(sourceCache, url)) {

@@ -354,3 +373,5 @@ // URL needs to be able to fetched within the acceptable domain. Otherwise,

var source = '';
if (url.indexOf(document.domain) !== -1) {
url = url || '';
if (url.indexOf && url.indexOf(document.domain) !== -1) {
source = loadSource(url);

@@ -592,2 +613,3 @@ }

// ex.lineNumber = 59
// ex.columnNumber = 69
// ex.stack = ...stack trace... (see the example below)

@@ -624,4 +646,5 @@ // ex.name = ReferenceError

var chrome = /^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
gecko = /^\s*(\S*)(?:\((.*?)\))?@((?:file|http|https).*?):(\d+)(?::(\d+))?\s*$/i,
var chrome = /^\s*at (.*?) ?\(?((?:file|https?|chrome-extension):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
gecko = /^\s*(.*?)(?:\((.*?)\))?@?((?:file|https?|chrome):.*?):(\d+)(?::(\d+))?\s*$/i,
winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
lines = ex.stack.split('\n'),

@@ -649,2 +672,9 @@ stack = [],

};
} else if ((parts = winjs.exec(lines[i]))) {
element = {
'url': parts[2],
'func': parts[1] || UNKNOWN_FUNCTION,
'line': +parts[3],
'column': parts[4] ? +parts[4] : null
};
} else {

@@ -665,10 +695,15 @@ continue;

if (!stack.length) {
return null;
}
if (stack[0] && stack[0].line && !stack[0].column && reference) {
stack[0].column = findSourceInLine(reference[1], stack[0].url, stack[0].line);
} else if (!stack[0].column && !_isUndefined(ex.columnNumber)) {
// FireFox uses this awesome columnNumber property for its top frame
// Also note, Firefox's column number is 0-based and everything else expects 1-based,
// so adding 1
stack[0].column = ex.columnNumber + 1;
}
if (!stack.length) {
return null;
}
return {

@@ -771,4 +806,4 @@ 'mode': 'stack',

var lineRE1 = /^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,
lineRE2 = /^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,
var lineRE1 = /^\s*Line (\d+) of linked script ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,
lineRE2 = /^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,
lineRE3 = /^\s*Line (\d+) of function script\s*$/i,

@@ -949,2 +984,8 @@ stack = [],

if (typeof item.func === 'undefined') {
try {
item.func = parts.input.substring(0, parts.input.indexOf('{'))
} catch (e) { }
}
if ((source = findSourceByFunctionBody(curr))) {

@@ -1078,3 +1119,3 @@ item.url = source.url;

*/
(function extendToAsynchronousCallbacks() {
TraceKit.extendToAsynchronousCallbacks = function () {
var _helper = function _helper(fnName) {

@@ -1102,3 +1143,3 @@ var originalFn = window[fnName];

_helper('setInterval');
}());
};

@@ -1117,2 +1158,7 @@ //Default options:

module.exports = TraceKit;
// Export to global object
window.TraceKit = TraceKit;
}(typeof window !== 'undefined' ? window : global));

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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