title: Does await await promise-like objects?
body: <p>According to <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await" rel="noreferrer">Mozilla</a>, await only awaits Promises:</p>
  
  <blockquote>
    <p>[rv] Returns the resolved value of the promise, or the value itself if it's not a Promise.</p>
  </blockquote>
  
  <p>If you await a non-Promise, a resolved promise will be immediately returned, and it will not await. However, the following code awaits without using Promises in Chrome &amp; FF.</p>
  
  <pre><code>var obj = {
      then:func =&gt; obj.func=func
  };
  setTimeout(() =&gt; obj.func(57), 1000);
  
  async function go() {
      var res = await obj;
      console.log(res); //shows '57' after 1000ms
  }
  
  go();
  </code></pre>
  
  <p>According to the specs, should await await promise-like objects that are not Promises? (I tried looking at the specs (linked from the Mozilla article), but I couldn't understand it.)</p>