@jdeighan/coffee-utils 6.0.6 → 6.0.7

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": "6.0.6",
4
+ "version": "6.0.7",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -26,7 +26,7 @@ export class CallStack
26
26
 
27
27
  if doDebugStack
28
28
  prefix = ' '.repeat(@lStack.length)
29
- LOG "#{prefix}[CALL #{funcName}]"
29
+ LOG "#{prefix}[> CALL #{funcName}]"
30
30
  @lStack.push({funcName, hInfo})
31
31
  return
32
32
 
@@ -37,14 +37,14 @@ export class CallStack
37
37
  if @lStack.length == 0
38
38
  LOG "returnFrom('#{fName}') but stack is empty"
39
39
  return undef
40
- if doDebugStack
41
- prefix = ' '.repeat(@lStack.length-1)
42
- LOG "#{prefix}[RETURN FROM #{fName}]"
43
40
  {funcName, hInfo} = @lStack.pop()
44
41
  while (funcName != fName) && (@lStack.length > 0)
45
42
  LOG "[MISSING RETURN FROM #{funcName} (return from #{fName})]"
46
43
  {funcName, hInfo} = @lStack.pop()
47
44
 
45
+ if doDebugStack
46
+ prefix = ' '.repeat(@lStack.length)
47
+ LOG "#{prefix}[< BACK #{fName}]"
48
48
  if (funcName == fName)
49
49
  return hInfo
50
50
  else
package/src/call_stack.js CHANGED
@@ -31,7 +31,7 @@ export var CallStack = class CallStack {
31
31
  var prefix;
32
32
  if (doDebugStack) {
33
33
  prefix = ' '.repeat(this.lStack.length);
34
- LOG(`${prefix}[CALL ${funcName}]`);
34
+ LOG(`${prefix}[> CALL ${funcName}]`);
35
35
  }
36
36
  this.lStack.push({funcName, hInfo});
37
37
  }
@@ -43,15 +43,15 @@ export var CallStack = class CallStack {
43
43
  LOG(`returnFrom('${fName}') but stack is empty`);
44
44
  return undef;
45
45
  }
46
- if (doDebugStack) {
47
- prefix = ' '.repeat(this.lStack.length - 1);
48
- LOG(`${prefix}[RETURN FROM ${fName}]`);
49
- }
50
46
  ({funcName, hInfo} = this.lStack.pop());
51
47
  while ((funcName !== fName) && (this.lStack.length > 0)) {
52
48
  LOG(`[MISSING RETURN FROM ${funcName} (return from ${fName})]`);
53
49
  ({funcName, hInfo} = this.lStack.pop());
54
50
  }
51
+ if (doDebugStack) {
52
+ prefix = ' '.repeat(this.lStack.length);
53
+ LOG(`${prefix}[< BACK ${fName}]`);
54
+ }
55
55
  if (funcName === fName) {
56
56
  return hInfo;
57
57
  } else {
@@ -34,6 +34,8 @@ export LOG = (lArgs...) ->
34
34
  console.log label
35
35
  return
36
36
 
37
+ export DEBUG = LOG # synonym
38
+
37
39
  # ---------------------------------------------------------------------------
38
40
 
39
41
  export setStringifier = (func) ->
package/src/log_utils.js CHANGED
@@ -59,6 +59,9 @@ export var LOG = function(...lArgs) {
59
59
  }
60
60
  };
61
61
 
62
+ export var DEBUG = LOG; // synonym
63
+
64
+
62
65
  // ---------------------------------------------------------------------------
63
66
  export var setStringifier = function(func) {
64
67
  var orgStringifier;