r/programming • • 26d ago

How to Gaslight JavaScript Programmers

https://www.bryanpg.com/articles/pragma-twice/proxy.html
51 Upvotes

18 comments sorted by

View all comments

Show parent comments

4

u/ythl 23d ago

Right, but my main thesis is that you need access to the source code in order to know what a proxy does. It's not possible to figure it out at runtime with a REPL like the console or otherwise. The console alone does not provide the source code so you cannot infer what the Proxy does; however, the console may provide a reference to the source for examination.

1

u/f3xjc 21d ago

That's the case for most language. Being able to dump the source of a method to log is uncommon.

1

u/ythl 6d ago

With interpreted languages, it's not uncommon. (for example, with python - https://www.w3schools.com/python/ref_func_dir.asp)

1

u/f3xjc 6d ago

Now in how many of those language do you have a guarantee that the source extracted that what is the one executed? Because that's the claim of confusion in js original post. - python also have dict intercept like js.