Make getBattery() always return the same promise (addresses ISSUE-166).
authorAnssi Kostiainen <anssi.kostiainen@intel.com>
Mon, 11 Aug 2014 11:01:32 +0300
changeset 565 27d83813c582
parent 564 6cb6dc26210d
child 566 f80f44c01c3f
Make getBattery() always return the same promise (addresses ISSUE-166).
battery/Overview.src.html
--- a/battery/Overview.src.html	Mon Aug 11 10:52:38 2014 +0300
+++ b/battery/Overview.src.html	Mon Aug 11 11:01:32 2014 +0300
@@ -156,7 +156,15 @@
       </p>
       <ul>
         <li>
-          Let <var>promise</var> be a newly created <a>Promise</a> and return it.
+          If there is an initialized <a>Promise</a> object returned by
+          <code>getBattery()</code>, let <var>promise</var> be that
+          <a>Promise</a> object.
+        </li>
+        <li>
+          Otherwise, let <var>promise</var> be a newly created <a>Promise</a>.
+        </li>
+        <li>
+          Return <var>promise</var>.
         </li>
         <li>
           If an instance of <a>BatteryManager</a> has previously been