<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23143</bug_id>
          
          <creation_ts>2013-09-03 21:50:28 +0000</creation_ts>
          <short_desc>Add an &quot;adopt&quot; hook for Promises</short_desc>
          <delta_ts>2013-09-06 15:03:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>DOM</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tab Atkins Jr.">jackalmage</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>d</cc>
    
    <cc>mike</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>92915</commentid>
    <comment_count>0</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-09-03 21:50:28 +0000</bug_when>
    <thetext>The Promises spec currently has API hooks for fulfilling and rejecting a promise.  It should also have a hook for adopting a promise.

Use-case: I&apos;m returning a promise from an operation in the Font Load Events API.  Sometimes it&apos;ll be rejected quickly and directly, so I need to have a handle for the promise itself.  If all goes well, though, the result should be as if Promise.every() was called on a spec-defined list of other promises, which requires me to have the original returned promise adopt the result of the Promise.every() algorithm (once it&apos;s defined in a spec fashion that can be safely invoked).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92916</commentid>
    <comment_count>1</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2013-09-03 21:59:13 +0000</bug_when>
    <thetext>From what I understand, this is asking for `Resolve`. https://github.com/domenic/promises-unwrapping#resolvep-x</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92941</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-04 09:07:19 +0000</bug_when>
    <thetext>Also an internal hook to Promise.every() that cannot be overridden I suspect. Similar to how XMLHttpRequest wants that for JSON.parse().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93105</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-06 15:03:17 +0000</bug_when>
    <thetext>Tab, I recommend chiming in here: https://github.com/domenic/promises-unwrapping/issues/21</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>