I wonder what % of the time this warning actually helps detect a problem.  The 
first (and only) example I looked at was in 
royale-asjs_js\frameworks\projects\Core\src\main\royale\org\apache\royale\utils\object\defineSimpleProperty.as
 where a manually defined get/set accessor has accessor functions (are they 
actually 'closures'?) that are, essentially, not separately referenced and thus 
unlikely to be called from a different context.

IIRC, Google Closure has a @lends annotation that might be used to turn off 
this warning in get/set setup code, and maybe elsewhere.
Or maybe the detection can be smarter, like detecting the function being 
assigned or passed-in somewhere.

Just wondering,
-Alex

On 12/18/21, 9:03 AM, "Harbs" <harbs.li...@gmail.com> wrote:

    How difficult would it be to add support for some kind of comment at the 
start of a function to turn it off for that function?

    > On Dec 17, 2021, at 7:18 PM, Josh Tynjala <joshtynj...@bowlerhat.dev> 
wrote:
    > 
    > No, it's all or nothing.
    > 
    > --
    > Josh Tynjala
    > Bowler Hat LLC 
<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbowlerhat.dev%2F&amp;data=04%7C01%7Caharui%40adobe.com%7C9284094113ac44658a8808d9c24846c9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637754437946343146%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=bxt8Ot1smEsxfPTlCYixm9XUs8%2Beva4jQOZ8%2B83DDiE%3D&amp;reserved=0>
    > 
    > 
    > On Fri, Dec 17, 2021 at 2:12 AM Harbs <harbs.li...@gmail.com> wrote:
    > 
    >> The “this within closure” warnings are sometimes annoying.
    >> 
    >> Is there any way to suppress the warnings for specific functions without
    >> turning off the warnings for a whole project?
    >> 
    >> Thanks,
    >> Harbs


Reply via email to