[Info-vax] [OT] The wonders of Javascript...
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Tue Mar 3 09:02:23 EST 2015
On 2015-03-02, hb <end.of at inter.net> wrote:
> On 03/02/2015 09:28 AM, Simon Clubley wrote:
>> Did your simplified example try referencing an undefined standalone
>> variable or a non-existant member of an object (which is what I
>> was doing) ?
>
> A variable. (I'm not sure what "standalone" should mean in
> this/Javascript context.) In Javascript, referencing a non-existant
> member of an object is not an error. The name or property to
> identify/reference a member of an object is not a variable.
>
Yes, in my example, the undefined reference was supposed to be a property
(which should contain an integer value) of an object instead of how
I loosely called it a variable.
What I meant by standalone variable was something declared as "var test1;"
instead of something which is a property of an object.
BTW, and IMHO, Javascript _not_ throwing an error when you reference a
non-existent property in a maths operation (but instead silently setting
the LHS of the assignment to a NaN) is absolutely insane. There is no
reason why something like that would ever be valid code.
I really hope no-one is using Javascript for safety critical code. :-)
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
More information about the Info-vax
mailing list