Jump to content

Activation, Prototype, Global Objects and Execution Context relation


Ramu26

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 ?
Thank,
Chandra
Link to comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...