Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow modifications of parsed CallSite objects #7

Open
yocontra opened this issue Apr 22, 2014 · 3 comments
Open

Allow modifications of parsed CallSite objects #7

yocontra opened this issue Apr 22, 2014 · 3 comments

Comments

@yocontra
Copy link

I'm trying to do some cool stack modification stuff to make things more detailed.

Example:

if (call.getMethodName() === '_onTimeout') {
  call.methodName = 'setTimeout';
  console.log(call.getMethodName()); // _onTimeout
 }
@felixge
Copy link
Owner

felixge commented Apr 22, 2014

Would overwriting the method you're interested in work? Happy to hear about API change suggestions if not.

@yocontra
Copy link
Author

@felixge Sure I could

call.methodName = 'setTimeout';
call.getMethodName = function() { return 'setTimeout'; }

but it doesn't feel totally right. I think we can adjust the functions to be more like

call.getMethodName = function() { return call.methodName; }

to allow for easier modifications. I'll send a PR if you think it sounds like a good idea

@felixge
Copy link
Owner

felixge commented Apr 22, 2014

SGTM, pull request it!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants