2011/10/21 Rahul <[email protected]>:

> object4 = {
>    name : "OBJECT-4",
>    action : function(greeting){
>              alert(greeting+" my name is "+this.name);
>              nestedFunction : function(){
>                alert(greeting+" my name is "+this.name);
>              }.bind(object4);
>              nestedFunction();
>   }.bind(alice)
> }

Putting a label at that position is not allowed. You should define it
the following way:

object4 = {
    name : "OBJECT-4",
    action : function(greeting){
              alert(greeting+" my name is "+this.name);
              var nestedFunction = function(){
                alert(greeting+" my name is "+this.name);
              }.bind(object4);
              nestedFunction();
   }.bind(alice)
 }

Or this is not your intent, please give details on why / how do you
think to put the label `nestedFunction` in the middle of a function.
If you want nestedFunction to be a property of object4, you should
either add it to the object literal as you did with `name` and
`action`, or create it as `this.nestedFunction` or
`this.action.nestedFunction`.

-- 
Poetro

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to