ECMAScript specification, section 8.7 The Reference Specification Type states:
The
Reference
type is used to explain the behaviour of such operators asdelete
,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?