Subj : Re: Any reason for Math.sin.__parent__ == Math ? To : Igor Bukanov From : Brendan Eich Date : Mon Mar 29 2004 10:01 am Igor Bukanov wrote: > Hi! > > In the current SM parent scope for functions of the standard host > objects points to the object itself and not to the global scope so: > > js> Math.sin.__parent__ == Math > true > js> Math.sin.__parent__ > [object Math] > js> Math.sin.__parent__.__parent__ > [object global] > js> > > Any reason for that? It seems ECMA 262 is silent on this issue. __parent__ is a generalization of [[Scope]], which ECMA-262 Edition 3 specifies only for Function objects created per 13.2. The spec does not cover the [[Scope]] property of native function objects. SpiderMonkey defines all static methods (Math.sin is analogous to Date.parse in this respect; they are called static methods after Java's class-member static methods) in the scope of their class constructor or prototype. Math is not a constructor, it's a prototype singleton. Is this ancient self-consistent behavior of SpiderMonkey causing some script use-case, or perhaps Rhino, some stress? /be .