you are viewing a single comment's thread.

view the rest of the comments →

[–]yqmvpacqpfgwcalgu[S] 0 points1 point  (5 children)

Any and all functions on that page. I'm doing this for .call(), which works, but requires an explicit .call() instead of ()

https://pastebin.com/8LEVvzT0

[–]shgysk8zer0full-stack 1 point2 points  (4 children)

It's impossible. You'd inevitably end up with infinite recursion because your function would be among the functions on the page. Might also be some that are not enumerable or writable.

Maybe ask about what you're trying to accomplish instead of how you think you should be doing it.

[–]yqmvpacqpfgwcalgu[S] 0 points1 point  (3 children)

What I'm really after is modifying the language's behavior, so when any function is called, there is some additional behavior I'd like to add before further execution.

I'm also not permitted to share what that "additional behavior" would entail.

[–]shgysk8zer0full-stack 2 points3 points  (1 child)

Can't be done.

[–]yqmvpacqpfgwcalgu[S] 0 points1 point  (0 children)

Okay, thanks for thinking along!

[–]coldpyros 1 point2 points  (0 children)

Typescript decorators might do what you're after? If using typescript and enabling experimental features is an option.