Thanks! your articles are very useful! On 27 май, 12:43, "T.J. Crowder" <[email protected]> wrote: > Hi, > > > One thing is stay for me unconvinient is calling private functions in > > public functions. > > It's nessety to call them with .bind(this)(...) > > No, that's a very inefficient way to call them. Instead: > > _privateFunction.call(this, arg1, arg2); > > or > > _privateFunction.apply(this, array_of_args); > > Function#call and Function#apply are part of JavaScript. More about > them in the spec[1], of course, and on MDC[2][3]. > > More about various approaches to private methods here[4] and (somewhat > indirectly) here[5]. > > [1]http://www.ecma-international.org/publications/standards/Ecma-262.htm > [2]https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/... > [3]https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/... > [4]http://blog.niftysnippets.org/2009/09/private-methods-in-javascript.html > [5]http://blog.niftysnippets.org/2010/03/anonymouses-anonymous.html > > HTH, > -- > T.J. Crowder > Independent Software Engineer > tj / crowder software / com > www / crowder software / com > > On May 26, 9:27 pm, buda <[email protected]> wrote: > > > > > > > > > One thing is stay for me unconvinient is calling private functions in > > public functions. > > It's nessety to call them with .bind(this)(...) > > > function publicFunc1(){ > > ... > > _private_prop1 = 45; > > _privateFunc1.bind(this)(); > > ... > > > } > > > May be you have suggestion on this
-- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
