So I finally did some testing. The following "source" code:

var closureVar = "Hello world of closures!" ;

qx.Class.define("test.Application",
{
  extend : qx.application.Standalone,
  members :
  {
    main : function()
    {
      this.base(arguments);
      var button1 = new qx.ui.form.Button("First Button", "test/test.png");
      var doc = this.getRoot();
      doc.add(button1, {left: 100, top: 50});
      button1.addListener("execute", function(e) {
        alert(closureVar);
      });
    }
  }
});

is transformed to the following "build " code:

(function(){var g="Hello world of closures!",f="test/test.png",d="First
Button",c="execute",b="test.Application";
var a=g;
qx.Class.define(b,{extend:qx.application.Standalone,members:{main:function(){qx.application.Standalone.prototype.main.call(this);
{};
var i=new qx.ui.form.Button(d,f);
var h=this.getRoot();
h.add(i,{left:100,top:50});
i.addListener(c,function(e){alert(a);
});
}}});
})();

As Thomas said, no code is removed and the class code is wrapped with a
function. So my assumptions were incorrect. Sorry about not doing more
reseach before posting!

Which, to close the issue, means that you can define variables outside the
class definition, as use them inside the qooxdoo class as super-safe data
containers. This might be worth mentioning in the docs. They won't be
documented in the API viewer, but that's part of the idea. Doug Crockford
suggests to save session, password or other sensitive data vulnerable to XSS
attacks in such variables.

Cheers,
Christian 
-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Scalable-Javascript-Architecture-tp5500032p5516074.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to