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

Static members on function not emitted #874

Description

@Eyas

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;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions