/tags/jsdoc_toolkit-2.3.2/jsdoc-toolkit/app/test/functions_nested.js

http://jsdoc-toolkit.googlecode.com/ · JavaScript · 33 lines · 18 code · 4 blank · 11 comment · 0 complexity · c1c191c68582a473253a32129d34bb2d MD5 · raw file

  1. /** @constructor */
  2. function Zop() {
  3. }
  4. /**
  5. @class
  6. */
  7. Foo = function(id) {
  8. // this is a bit twisted, but if you call Foo() you will then
  9. // modify Foo(). This is kinda, sorta non-insane, because you
  10. // would have to call Foo() 100% of the time to use Foo's methods
  11. Foo.prototype.methodOne = function(bar) {
  12. alert(bar);
  13. };
  14. // same again
  15. Foo.prototype.methodTwo = function(bar2) {
  16. alert(bar2);
  17. };
  18. // and these are only executed if the enclosing function is actually called
  19. // and who knows if that will ever happen?
  20. Bar = function(pez) {
  21. alert(pez);
  22. };
  23. Zop.prototype.zap = function(p){
  24. alert(p);
  25. };
  26. // but this is only visible inside Foo
  27. function inner() {
  28. }
  29. };