Re: [closure-compiler-discuss] Exposing dynamically created functions on objects

68 views
Skip to first unread message

Nick Santos

unread,
Jul 27, 2012, 10:31:30 AM7/27/12
to closure-comp...@googlegroups.com
A jsdoc annotation starts with "/**", not "/*"

On Fri, Jul 27, 2012 at 1:27 AM, <pgo...@gmail.com> wrote:
> Hi,
>
> I am have just started learning javascript and the closure compiler
>
> I am trying to annotate my javascript so that closure doesnt rename all the
> exported symbols since i am working with vanilla javascript as well.
>
> /**
> * @constructor
> * @expose
> * @type{foo}
> */
>
> foo = function (el, args) {
> "use strict";
> var s = "Hello World";
> /*
> * @expose
> * @this {foo}
> * @type {function}
> */
> this.introduce = function () {
> return s;
> };
> };
>
> However the generated output when i run it through the closure compiler with
> advanced optimization is
>
> foo = function() {
> this.a = function() {
> return"Hello World"
>
> } };
>
> How do i ask closure to preserve the name introduce since this will be
> called from an external javascript.
>
>
> Thanks,
>
> Gokul
Reply all
Reply to author
Forward
0 new messages