It's not possible at this time.
Java has an annotation for suppressing warnings locally:
@SuppressWarnings({"unchecked", "deprecated"})
More info: https://www.baeldung.com/java-suppresswarnings
It might be interesting to allow something similar in AS3:
[SuppressWarnings(this-within-closure,assignment-within-conditional)]
I'm not sure if dashes are allowed in AS3 metadata attributes, but
basically, the idea is to have the attribute names match the existing
compiler options for each type of warning that can be suppressed.
--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>
On Tue, Dec 3, 2019 at 10:09 AM Harbs <[email protected]> wrote:
> What about locally?
>
> > On Dec 3, 2019, at 7:39 PM, Josh Tynjala <[email protected]>
> wrote:
> >
> > You can turn it off with the following compiler option:
> > -warn-this-within-closure=false
> >
> > --
> > Josh Tynjala
> > Bowler Hat LLC <https://bowlerhat.dev>
> >
> >
> > On Tue, Dec 3, 2019 at 9:36 AM Harbs <[email protected]> wrote:
> >
> >> I recently started getting some of these warnings:
> >>
> >> Warning: Encountered this keyword within closure. Value of this will not
> >> be the same as enclosing scope.
> >>
> >> I understand the desire to have this warning, but I think it either
> needs
> >> to be smarter or be easily turned off.
> >>
> >> I have a case where I have Object.defineProperty which takes a function
> >> that needs to refer to “this”. That’s a valid use of this within a
> >> “closure”, and I can’t find an easy way of turning the warning off for
> that
> >> use case.
> >>
> >> Harbs
>
>