eval on non-strings
brendan at mozilla.org
Tue Feb 28 02:04:06 PST 2012
Andreas Rossberg wrote:
> On 26 February 2012 19:32, Allen Wirfs-Brock<allen at wirfs-brock.com> wrote:
>> The change can't be predicated on strict code because it concerns the definition of a built-in function that is called from any code. Strict mode restrictions must be tied to a lexical context.
> We already distinguish direct eval, which is lexical, so we could make
> a strict mode distinction there.
> I agree it's hardly worth changing though. There are far more
> hazardous places where the language opts for unhelpful "soft failure",
> and it looks like we are even adding new ones.
Fail-soft in JS1 was an artifact of lack of try-catch combined with too
much rushed Unix philosophy. In cases such as delete you could get a
status result (boolean telling whether the delete failed hard if false,
else either succeeded or found no "own" property if true). In other
cases of course an implicit coercion was done (*sigh*).
All water under the bridge but I agree we should not add more. Where do
you see new fail-soft (or worse, fail-soft with ambiguity) being added?
More information about the es-discuss