W3C home > Mailing lists > Public > www-voice@w3.org > July to September 2014

Re: SCXML Test 553 assumes unset variables are invalid

From: David Junger <tffy@free.fr>
Date: Thu, 3 Jul 2014 07:50:41 +0200
Message-Id: <3A8E8DF9-EFC6-44B9-B012-A59A158172DA@free.fr>
To: "www-voice@w3.org (www-voice@w3.org)" <www-voice@w3.org>
Le 3 jul 2014 à 02:58, Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> a écrit :

> But I am having trouble to determine whether something is a valid LHS, how would you check such a thing in JavaScript? I could have “NAMELIST_ENTRY = undefined;” and see if I can parse it, without evaluating it but I was wondering if someone thought of something more clever?

Currently, JSSC also doesn't bother checking whether names in a namelist are valid LHS expressions.
However, for <assign>, what I do is essentially what you suggest. I save the original value in a temporary variable, then try{ eval("LHS = value") } catch(error){ if(error instanceOf ReferenceError) … }
and that's how I'll probably do it for this test. Try to assign some value (doesn't matter what) and catch ReferenceError, then reassign the original value and proceed (but since you have greater control over the ECMAScript runtime you can stop at parsing which is even better).

			David
Received on Thursday, 3 July 2014 05:51:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:07:45 UTC