Closure object (Object/internal)

A special kind of function object that preserves prototype inheritance and scope.

Availability:

JavaScript - 1.2
Netscape - 4.0
JavaScript syntax:NmyClosure = new Closure()
Object properties:__parent__, __proto__

This is a special kind of object, which maintains some contextual state information when it is created.

It can behave like a function, but is a kind of function wrapper that references a function and a scope. Since it inherits everything from the Function object, it can behave like a function and can be called as such.

Because it also stores the scope chain at the time it is manufactured, it can restore that scope chain when it is executed.

See also:Lexical scoping

PropertyJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
__parent__1.2 1.2 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a n/a-
__proto__1.2 1.2 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a n/a-