Re: [heycam/webidl] "array index property name" doesn't guard against failure (#346)

I must be missing something.

https://heycam.github.io/webidl/#dfn-array-index-property-name says:

> which is a property name P such that Type(P) is String and for which the following algorithm returns true

So we land in https://tc39.github.io/ecma262/#sec-touint32 which can only throw via ToNumber, and our argument is guaranteed to be a String.  https://tc39.github.io/ecma262/#sec-tonumber in the string case says:

> ToNumber applied to Strings applies the following grammar to the input String interpreted as a sequence of UTF-16 encoded code points (6.1.4). If the grammar cannot interpret the String as an expansion of StringNumericLiteral, then the result of ToNumber is NaN.

so how can this throw?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/346#issuecomment-294914028

Received on Tuesday, 18 April 2017 17:12:06 UTC