clutz icon indicating copy to clipboard operation
clutz copied to clipboard

gents doesn't handle variable name collisions after renaming exports.

Open stringham opened this issue 8 years ago • 0 comments

goog.provide('foo.namespace.Foo');
goog.provide('foo.namespace.Foo.values');

/**
 * @constructor
 */
foo.namespace.Foo = function() {
    let values = foo.namespace.Foo.values;
    this.value = values.a;
}


/**
 * @const
 */
foo.namespace.Foo.values = {
    a:1,
    b:2,
    c:3
}

gets turned into:

export class Foo {
    value: any;

    constructor() {
        let values = values;
        this.value = values.a;
    }
}

export const values = {
    a: 1,
    b: 2,
    c: 3
};

notice the let values = values in the resulting TypeScript.

stringham avatar Jul 31 '17 05:07 stringham