@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jdeighan/coffee-utils",
3
3
  "type": "module",
4
- "version": "7.0.34",
4
+ "version": "7.0.35",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -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'
@@ -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, e, i, lCallers, len, stackTrace;
61
+ var caller, i, lCallers, len, stackTrace;
62
62
  if (!cond) {
63
- try {
64
- throw new Error();
65
- } catch (error1) {
66
- e = error1;
67
- stackTrace = e.stack;
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