js-shield
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New wrappers


From: Libor Polčák
Subject: Re: New wrappers
Date: Mon, 13 Sep 2021 11:59:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.9

Hello all,

We have working integration tests for the 0.5 release 
https://pagure.io/JS-Shield/JS-Shield/c/7a5aae4712f95845aadc2235aa2348a64ba1d19b.
 I still have some minor tweaks to integrate but the 0.5 release is imminent.

Giorgio, I improved the new_wrappers docs 
https://pagure.io/JS-Shield/JS-Shield/c/7e3fe2896a3fe9b10bdefff229e206e3d2a7944c.
 Feel free to clarify better.

Thanks for all the huge effort.

Libor


On 10/09/21 14:25, Libor Polčák wrote:

Giorgio finished the development of the improved wrapping code dealing with the 
bugs realted to early injection and reliable injection in Firefox when wisiting 
pages with CSP. See 
https://pagure.io/JS-Shield/JS-Shield/blob/nscl3/f/docs/new_wrapper.md.

Giorgio, I am little confused about wrapped_name and callable_name. Is the 
following true?

"Generally speaking, use wrapped_name whenever you need to access the original 
objects only inside
the wrapper and you do not need to pass the object to other code, such as 
`Promise` objects or
callbacks. Compared to `callable_name`, `wrapped_name` has less overhead and is the 
preferred way."
That's correct.

Am I right that it does not make sense to define both callable_name and 
wrapped_name?

It usually doesn't, but IMHO keeping the ability to define both is good  for 
flexibility sake: even though in current wrappers (at least those which I've 
worked on) you needed either one or the other, you can actually define both in 
order to keep around 2 references for possibly different purposes:

 1. wrapped_name points to the actual original object, unadulterated: you might 
need it for identity comparisons or other instance-specific use cases
 2. callable_name points to a *proxy* to the original object, intercepting 
calls and automatically marshaling parameters and return values, but with this 
alone you can't take any handle of the actual original native object

As things are currently set up, depending on what you want to do, you can have 
one, the other or both.

Do you think we can make the documentation less confusing about this point?

Thanks!

-- G




Thanks

Libor


--
Giorgio Maone
https://maone.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]