[Bug 21635] New: "resolve" in Future example should probably be "resolver"

https://www.w3.org/Bugs/Public/show_bug.cgi?id=21635

            Bug ID: 21635
           Summary: "resolve" in Future example should probably be
                    "resolver"
    Classification: Unclassified
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DOM
          Assignee: annevk@annevk.nl
          Reporter: harald@alvestrand.no
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, www-dom@w3.org

>From the example:

    xhr.onload = function() {
      if(xhr.response)
        resolver.resolve(xhr.response)
      resolve.reject(new DOMError("JSONError"))
    }
    xhr.onloadend = function() { resolver.reject(new DOMError("NetworkError"))
}
  })

If "resolve" in line 4 is "resolver", I think I understand this.

BTW: The idiom of "reject does nothing if resolver.resolve succeeded" wasn't
obvious to me until the third reading; it might be reader-friendly to add a
comment about this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Tuesday, 9 April 2013 09:15:32 UTC