Jump to content

Activation, Prototype, Global Objects and Execution Context relation

Recommended Posts

Hi All,

When we create a object and invoke a method on it.
1. Instance will be searched and then the prototype and so on till the Object prototype; when will the Global object be searched ?
also what is the role of activation Object ?
My understanding is.
1. when we invoke a object Activation object will be created which will have references to prototype and constructor
2. prototype chain continues to supertype up till Object as every object extends Object
3. Finally Object prototype will have refrences to Global/Window Object right
So is the sequence, activation Object Of instance ->supertype prototype -> Object prototype -> Global Window Object type
correct ?
Link to post
Share on other sites

Objects that you define are not extended from the window object. If you try to run a method on an object that does not exist on that object, but does exist on the window object, it does not run the global version. If the object itself does not have the method defined then it is simply an undefined method.Don't confuse that with scoping. When you reference an unqualified function or variable, and it can't find it in the current scope, it will go up the scope chain until it gets to the window object and then check there. The window object is the top-level scope.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...