iriscouch / traceback

Easy access to the call stack, for Node.js
Apache License 2.0
44 stars 6 forks source link

TypeError: CallSite method getThis expects CallSite as receiver #9

Open dpnishant opened 6 years ago

dpnishant commented 6 years ago

I'm facing the following error with the following test code:

Test Code

var traceback = require('traceback');
const crypto = require('crypto');
const fs = require('fs');

fs.readFile(__filename, function () {
  crypto.randomBytes(256, function () {
    var stack = traceback();
    console.log(stack[0]); 
  });
});

Error

/Users/n/node_modules/traceback/lib/frame.js:24
  frame.this      = frame.getThis()
                          ^

TypeError: CallSite method getThis expects CallSite as receiver
    at CallSite.getThis (<anonymous>)
    at Object.make_easy [as make] (/Users/n/node_modules/traceback/lib/frame.js:24:27)
    at /Users/n/node_modules/traceback/traceback.js:38:54
    at Array.map (<anonymous>)
    at traceback (/Users/n/node_modules/traceback/traceback.js:38:16)
    at Object.<anonymous> (/Users/n/Desktop/trace-test.js:2:13)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)

Node Version

➜  Desktop node -v
v8.9.4

traceback Module Version

➜  Desktop npm list traceback
/Users/n
└── traceback@0.3.1
ajaysarw commented 4 years ago

I am facing the same issue.