Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zeekay
committed
Apr 1, 2017
1 parent
30b0ea0
commit 9672122
Showing
14 changed files
with
116 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
require('./lib/register') | ||
'use strict'; | ||
|
||
// src/coffee.coffee | ||
var _prepareStackTrace; | ||
|
||
_prepareStackTrace = Error.prepareStackTrace; | ||
|
||
var coffeeDetected = /formatSourcePosition\(frame, getSourceMapping/.test(_prepareStackTrace); | ||
|
||
// src/install.coffee | ||
var install = function(options = {}) { | ||
if (options.handleUncaughtExceptions == null) { | ||
options.handleUncaughtExceptions = true; | ||
} | ||
if (options.structuredStackTrace == null) { | ||
options.structuredStackTrace = false; | ||
} | ||
if (options.handleUncaughtExceptions) { | ||
process.on('uncaughtException', function(err) { | ||
(require('./utils')).prettyPrint(err, { | ||
colorize: process.stdout.isTTY | ||
}); | ||
return process.exit(1); | ||
}); | ||
} | ||
return Error.prepareStackTrace = function(err, stack) { | ||
var _stack, frame; | ||
_stack = (function() { | ||
var i, len, results; | ||
results = []; | ||
for (i = 0, len = stack.length; i < len; i++) { | ||
frame = stack[i]; | ||
results.push((require('./callsite/wrap'))(err, frame)); | ||
} | ||
return results; | ||
})(); | ||
if (options.structuredStackTrace) { | ||
err.structuredStackTrace = require('./structured-stack-trace')(err, stack); | ||
} | ||
return err + ((function() { | ||
var i, len, results; | ||
results = []; | ||
for (i = 0, len = _stack.length; i < len; i++) { | ||
frame = _stack[i]; | ||
results.push('\n at ' + frame); | ||
} | ||
return results; | ||
})()).join(''); | ||
}; | ||
}; | ||
|
||
// src/register.coffee | ||
install({ | ||
handleUncaughtExceptions: false | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
module.exports = | ||
clone: require './clone' | ||
wrap: require './wrap' | ||
import clone from './clone' | ||
import wrap from './wrap' | ||
|
||
export { | ||
clone | ||
wrap | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
_prepareStackTrace = Error.prepareStackTrace | ||
|
||
coffeeDetected = /formatSourcePosition\(frame, getSourceMapping/.test _prepareStackTrace | ||
coffeePrepare = if coffeeDetected then _prepareStackTrace else null | ||
|
||
module.exports = | ||
coffeeDetected: coffeeDetected | ||
coffeePrepare: coffeePrepare | ||
export coffeeDetected = /formatSourcePosition\(frame, getSourceMapping/.test _prepareStackTrace | ||
export coffeePrepare = if coffeeDetected then _prepareStackTrace else null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
Object.defineProperties module.exports, | ||
callsite: enumerable: true, get: -> require './callsite' | ||
coffee: enumerable: true, get: -> require './coffee' | ||
install: enumerable: true, get: -> require './install' | ||
sourceMapSupport: enumerable: true, get: -> require './source-map-support' | ||
structuredStackTrace: enumerable: true, get: -> require './structured-stack-trace' | ||
utils: enumerable: true, get: -> require './utils' | ||
import * as callsite from './callsite' | ||
import * as coffee from './coffee' | ||
import * as utils from './utils' | ||
import install from './install' | ||
import structuredStackTrace from './structured-stack-trace' | ||
import {mapEvalOrigin, mapSourcePosition} from './source-map-support' | ||
|
||
export { | ||
callsite | ||
coffee | ||
install | ||
mapEvalOrigin | ||
mapSourcePosition | ||
structuredStackTrace | ||
utils | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
(require './install') | ||
handleUncaughtExceptions: false | ||
import install from './install' | ||
install handleUncaughtExceptions: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters