Real world examples of Ecmascript functions returning a Reference?
- by Bergi
Read the EcmaScript specification, section 8.7 The Reference Specification Type:
The Reference type is used to explain the behaviour of such operators as delete, typeof, and the assignment operators. […] A Reference is a resolved name binding.
Function calls are permitted to return references. This possibility is admitted purely for the sake of host objects. No built-in ECMAScript function defined by this specification returns a reference and there is no provision for a user-defined function to return a reference.
Those last two sentences impressed me. With this, you could do things like coolHostFn() = value (valid syntax, btw). So my question is:
Are there any EcmaScript implementations that define host function objects which result in Reference values?