Why does Closure compiler rename properties of an extern type?

后端 未结 1 950
小蘑菇
小蘑菇 2021-01-04 09:58

I put this in an externs file:

/** @typedef {{english: string, spanish: string}} */
var SpanishNoun;

Then I have javascript:



        
相关标签:
1条回答
  • 2021-01-04 10:48

    typedefs don't participate in the renaming calculation

    This type definition will:

    /** @interface */
    function SpanishNoun() {}
    /** @type {string} */
    SpanishNoun.prototype.english;
    /** @type {string} */
    SpanishNoun.prototype.spanish;
    
    0 讨论(0)
提交回复
热议问题