John Harris
3/24/2016 11:22:00 AM
On Thu, 24 Mar 2016 04:20:45 +0100, Thomas 'PointedEars' Lahn
<PointedEars@web.de> wrote:
<snip>
>There are no pointers to functions. Proper terminology includes: ?reference
>to a Function instance?, ?reference to a function object?, and ?reference to
>a function?.
<snip>
What nonsense!
When ECMA 262 Ed 6 uses the word "reference", all lower case, it is
using the word to mean something referring to something : to a
Standard, to some part of ECMA 262, to some part of a program's source
code, or to a property. It is a general word, not a defined piece of
ECMAScript terminology.
When a value is specified to be an object or a primitive string an
implementation of ECMAScript will almost certainly use a pointer to
what might be a large data structure. It can do this provided the
Standard is still obeyed. Calling it a pointer is perfectly correct.
The word reference can be used when talking about the meaning of
source code that uses a value implemented internally as a
pointer-to-data. The word indicates that the language does not allow
you to know about or manipulate pointers themselves. Execution
automatically follows a pointer to its destination data. The word is
still not an ECMAScript-defined term.
John
PS Annex E of ECMA 262 Ed 6 says :
6.2.3: In ECMAScript 2015, Function calls are not allowed to return
a Reference value.