@jdeighan/coffee-utils 7.0.34 → 7.0.35
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/coffee_utils.coffee +5 -4
- package/src/coffee_utils.js +6 -7
package/package.json
CHANGED
package/src/coffee_utils.coffee
CHANGED
@@ -61,10 +61,11 @@ getCallers = (stackTrace, lExclude=[]) ->
|
|
61
61
|
export assert = (cond, msg) ->
|
62
62
|
|
63
63
|
if ! cond
|
64
|
-
try
|
65
|
-
throw new Error()
|
66
|
-
catch e
|
67
|
-
stackTrace = e.stack
|
64
|
+
# try
|
65
|
+
# throw new Error()
|
66
|
+
# catch e
|
67
|
+
# stackTrace = e.stack
|
68
|
+
stackTrace = new Error().stack
|
68
69
|
lCallers = getCallers(stackTrace, ['assert'])
|
69
70
|
|
70
71
|
# console.log 'STACK'
|
package/src/coffee_utils.js
CHANGED
@@ -58,14 +58,13 @@ getCallers = function(stackTrace, lExclude = []) {
|
|
58
58
|
// assert - mimic nodejs's assert
|
59
59
|
// return true so we can use it in boolean expressions
|
60
60
|
export var assert = function(cond, msg) {
|
61
|
-
var caller,
|
61
|
+
var caller, i, lCallers, len, stackTrace;
|
62
62
|
if (!cond) {
|
63
|
-
try
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
}
|
63
|
+
// try
|
64
|
+
// throw new Error()
|
65
|
+
// catch e
|
66
|
+
// stackTrace = e.stack
|
67
|
+
stackTrace = new Error().stack;
|
69
68
|
lCallers = getCallers(stackTrace, ['assert']);
|
70
69
|
// console.log 'STACK'
|
71
70
|
// console.log stackTrace
|