No idea. I’d have thought it would rename it as well.

> On Nov 9, 2021, at 2:15 PM, Yishay Weiss <[email protected]> wrote:
> 
> I was playing around with it, trying to demonstrate the advantages of typed 
> objects, expecting Object to mess up function calls. The demo glitch was that 
> GCC was fine with a looser version.
> 
> From: Harbs<mailto:[email protected]>
> Sent: Tuesday, November 9, 2021 2:13 PM
> To: [email protected]<mailto:[email protected]>
> Subject: Re: Why Does GCC Not Rename This?
> 
> Why is it Object and not “Editor”?
> 
>    private var editor:Editor;
> 
> 
>> On Nov 9, 2021, at 2:03 PM, Harbs <[email protected]> wrote:
>> 
>> Oh. I misread what you wrote. I thought you were asking about “theme”.
>> 
>> -js-dynamic-access-unknown-members=true is probably effecting that. What 
>> compiler option is being used?
>> 
>>> On Nov 9, 2021, at 1:59 PM, Harbs <[email protected]> wrote:
>>> 
>>> @nocollapse is what prevents renaming.
>>> 
>>> Why it’s writing @nocollapse is another question...
>>> 
>>>> On Nov 9, 2021, at 1:36 PM, Yishay Weiss <[email protected]> wrote:
>>>> 
>>>> 
>>>> An application that uses this class [1] minifies to this [2]. In
>>>> 
>>>> org.apache.royale.ace.ACEEditor.prototype.set__theme = function(value) {
>>>> this.org_apache_royale_ace_ACEEditor__theme = value;
>>>> var /** @type {Object} */ obj = this.editor;
>>>> obj.setTheme(value);
>>>> };
>>>> 
>>>> I expected the closure compiler to rename setTheme(), but instead it 
>>>> retained it. How did it know to do that? Is it because it’s an Object type?
>>>> 
>>>> 
>>>> [1] Apache Paste Bucket<https://paste.apache.org/gg0dy>
>>>> [2] Apache Paste Bucket<https://paste.apache.org/4c5f0>
>>> 
>> 
> 

Reply via email to