Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Static members on function not emitted #874

Open
Eyas opened this issue Apr 26, 2019 · 0 comments
Open

Static members on function not emitted #874

Eyas opened this issue Apr 26, 2019 · 0 comments

Comments

@Eyas
Copy link

Eyas commented Apr 26, 2019

I tried this twice, with goog.provide and goog.module, with similar results:

Actual

Using Provide

goog.provide('lib.my');

/**
 * @param {string} data
 */
lib.my.resemble = function(data) {};

/** @returns {string} data */
lib.my.resemble.staticOne = function(data) {};

/**
 * @const
 * @type {function(string)}
 */
lib.my.resemble.staticTwo = function(data) {};

Processing that using:

clutz_release.jar ./test.js

produces

declare namespace ಠ_ಠ.clutz.lib.my {
  function resemble (data : string ) : void ;
}
declare module 'goog:lib.my' {
  import my = ಠ_ಠ.clutz.lib.my;
  export = my;
}

Using Module

goog.module('lib.my');

/**
 * @param {string} data
 */
var resemble = function(data) {};

/** @returns {string} data */
resemble.staticOne = function(data) {};

/**
 * @const
 * @type {function(string)}
 */
resemble.staticTwo = function(data) {};

exports.resemble = resemble;

Outputs:

declare namespace ಠ_ಠ.clutz.module$exports$lib$my {
  function resemble (data : string ) : void ;
}
declare module 'goog:lib.my' {
  import my = ಠ_ಠ.clutz.module$exports$lib$my;
  export = my;
}

Expected

declare namespace ಠ_ಠ.clutz.module$exports$lib$my {
  namespace resemble {
    function staticOne (data : any ) : string ;
    function staticTwo (a : string ) : any ;
  }
  function resemble (data : string ) : void ;
}
declare module 'goog:lib.my' {
  import my = ಠ_ಠ.clutz.module$exports$lib$my;
  export = my;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant