This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20560 - misplaced comma
Summary: misplaced comma
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-04 01:54 UTC by Marcos Caceres
Modified: 2013-01-14 04:30 UTC (History)
3 users (show)

See Also:


Attachments

Description Marcos Caceres 2013-01-04 01:54:54 UTC
I think this needs to be rewritten:

"Let length be one greater than V’s maximum indexed property index, if V is a platform object that supports indexed properties, or the result of calling [[Get]] on V with property name “length” otherwise."

to:

"If V is a platform object that supports indexed properties, let length be one greater than V’s maximum indexed property index. Otherwise, let length be the result of calling [[Get]] on V with property name “length”."
Comment 1 Cameron McCormack 2013-01-14 03:18:58 UTC
I try to avoid variable declarations that are not at the beginning of the step, since "let" implies a scope to me that would be defeated by if the "if" statement around it.  So if anything I would reword it as:

  Let length be a value determined based on the type of V:
    -- a platform object that supports indexed properties
         The value is one greater than V's maximum indexed property index.
    -- otherwise
         The value is the result of calling [[Get]] on V with property name
         "length".

But I don't think it's particularly unclear at the moment.  There are plenty of other instances of "x, if y, otherwise z" in the spec.
Comment 2 Garrett 2013-01-14 04:30:09 UTC
I agree it is awkward and I don't especially like having "otherwise" used as a disjunctive "else" placed at the end of the sentence.

The direction of what you've written in your follow up comment is a lot clearer.