module-barejs_polyfill.WeakMap.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: WeakMap</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Class: WeakMap</h1>
  17. <section>
  18. <header>
  19. <h2><span class="attribs"><span class="type-signature"></span></span>
  20. <span class="ancestors"><a href="module-barejs_polyfill.html">barejs/polyfill</a>.</span>WeakMap<span class="signature">(_iterable<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h2>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h4 class="name" id="WeakMap"><span class="type-signature"></span>new WeakMap<span class="signature">(_iterable<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
  25. <div class="description">
  26. <p>Mimics the implementation of a native <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap">WeakMap</a>.
  27. The only way to achieve this is by putting a property on the key object.</p>
  28. </div>
  29. <h5>Parameters:</h5>
  30. <table class="params">
  31. <thead>
  32. <tr>
  33. <th>Name</th>
  34. <th>Type</th>
  35. <th>Attributes</th>
  36. <th>Default</th>
  37. <th class="last">Description</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <tr>
  42. <td class="name"><code>_iterable</code></td>
  43. <td class="type">
  44. <span class="param-type">any</span>
  45. </td>
  46. <td class="attributes">
  47. &lt;optional><br>
  48. </td>
  49. <td class="default">
  50. null
  51. </td>
  52. <td class="description last"><p>Optional: an iterable whose values will be added to the WeakSet.</p></td>
  53. </tr>
  54. </tbody>
  55. </table>
  56. <dl class="details">
  57. <dt class="tag-source">Source:</dt>
  58. <dd class="tag-source"><ul class="dummy"><li>
  59. <a href="polyfill_WeakMap.js.html">polyfill/WeakMap.js</a>, <a href="polyfill_WeakMap.js.html#line20">line 20</a>
  60. </li></ul></dd>
  61. </dl>
  62. </div>
  63. <h3 class="subsection-title">Methods</h3>
  64. <h4 class="name" id="delete"><span class="type-signature"></span>delete<span class="signature">(_key)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  65. <div class="description">
  66. <p>Remove the value for the specified key</p>
  67. </div>
  68. <h5>Parameters:</h5>
  69. <table class="params">
  70. <thead>
  71. <tr>
  72. <th>Name</th>
  73. <th>Type</th>
  74. <th class="last">Description</th>
  75. </tr>
  76. </thead>
  77. <tbody>
  78. <tr>
  79. <td class="name"><code>_key</code></td>
  80. <td class="type">
  81. <span class="param-type">object</span>
  82. </td>
  83. <td class="description last"><p>The object to use as key.</p></td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. <dl class="details">
  88. <dt class="tag-source">Source:</dt>
  89. <dd class="tag-source"><ul class="dummy"><li>
  90. <a href="polyfill_WeakMap.js.html">polyfill/WeakMap.js</a>, <a href="polyfill_WeakMap.js.html#line91">line 91</a>
  91. </li></ul></dd>
  92. </dl>
  93. <h5>Returns:</h5>
  94. <div class="param-desc">
  95. <p>True if the entry was deleted, false otherwise</p>
  96. </div>
  97. <dl>
  98. <dt>
  99. Type
  100. </dt>
  101. <dd>
  102. <span class="param-type">boolean</span>
  103. </dd>
  104. </dl>
  105. <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(_key)</span><span class="type-signature"></span></h4>
  106. <div class="description">
  107. <p>Get the value for the specified key</p>
  108. </div>
  109. <h5>Parameters:</h5>
  110. <table class="params">
  111. <thead>
  112. <tr>
  113. <th>Name</th>
  114. <th>Type</th>
  115. <th class="last">Description</th>
  116. </tr>
  117. </thead>
  118. <tbody>
  119. <tr>
  120. <td class="name"><code>_key</code></td>
  121. <td class="type">
  122. <span class="param-type">object</span>
  123. </td>
  124. <td class="description last"><p>The object to use as key.</p></td>
  125. </tr>
  126. </tbody>
  127. </table>
  128. <dl class="details">
  129. <dt class="tag-source">Source:</dt>
  130. <dd class="tag-source"><ul class="dummy"><li>
  131. <a href="polyfill_WeakMap.js.html">polyfill/WeakMap.js</a>, <a href="polyfill_WeakMap.js.html#line68">line 68</a>
  132. </li></ul></dd>
  133. </dl>
  134. <h5>Returns:</h5>
  135. <div class="param-desc">
  136. <p>The value, or undefined if the key is not known.</p>
  137. </div>
  138. <h4 class="name" id="has"><span class="type-signature"></span>has<span class="signature">(_key)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  139. <div class="description">
  140. <p>Check if the WeakMap has an entry for the specified key</p>
  141. </div>
  142. <h5>Parameters:</h5>
  143. <table class="params">
  144. <thead>
  145. <tr>
  146. <th>Name</th>
  147. <th>Type</th>
  148. <th class="last">Description</th>
  149. </tr>
  150. </thead>
  151. <tbody>
  152. <tr>
  153. <td class="name"><code>_key</code></td>
  154. <td class="type">
  155. <span class="param-type">object</span>
  156. </td>
  157. <td class="description last"><p>The object to use as key.</p></td>
  158. </tr>
  159. </tbody>
  160. </table>
  161. <dl class="details">
  162. <dt class="tag-source">Source:</dt>
  163. <dd class="tag-source"><ul class="dummy"><li>
  164. <a href="polyfill_WeakMap.js.html">polyfill/WeakMap.js</a>, <a href="polyfill_WeakMap.js.html#line79">line 79</a>
  165. </li></ul></dd>
  166. </dl>
  167. <h5>Returns:</h5>
  168. <div class="param-desc">
  169. <p>True if there is an entry for the key, false otherwise</p>
  170. </div>
  171. <dl>
  172. <dt>
  173. Type
  174. </dt>
  175. <dd>
  176. <span class="param-type">boolean</span>
  177. </dd>
  178. </dl>
  179. <h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(_key, _value)</span><span class="type-signature"> &rarr; {<a href="module-barejs_polyfill.WeakMap.html">module:barejs/polyfill.WeakMap</a>}</span></h4>
  180. <div class="description">
  181. <p>Adds a new element with a specified key and value to a WeakMap object.</p>
  182. </div>
  183. <h5>Parameters:</h5>
  184. <table class="params">
  185. <thead>
  186. <tr>
  187. <th>Name</th>
  188. <th>Type</th>
  189. <th class="last">Description</th>
  190. </tr>
  191. </thead>
  192. <tbody>
  193. <tr>
  194. <td class="name"><code>_key</code></td>
  195. <td class="type">
  196. <span class="param-type">object</span>
  197. </td>
  198. <td class="description last"><p>The object to use as key.</p></td>
  199. </tr>
  200. <tr>
  201. <td class="name"><code>_value</code></td>
  202. <td class="type">
  203. </td>
  204. <td class="description last"><p>The value to add.</p></td>
  205. </tr>
  206. </tbody>
  207. </table>
  208. <dl class="details">
  209. <dt class="tag-source">Source:</dt>
  210. <dd class="tag-source"><ul class="dummy"><li>
  211. <a href="polyfill_WeakMap.js.html">polyfill/WeakMap.js</a>, <a href="polyfill_WeakMap.js.html#line50">line 50</a>
  212. </li></ul></dd>
  213. </dl>
  214. <h5>Returns:</h5>
  215. <div class="param-desc">
  216. <p>The WeakMap (for chaining)</p>
  217. </div>
  218. <dl>
  219. <dt>
  220. Type
  221. </dt>
  222. <dd>
  223. <span class="param-type"><a href="module-barejs_polyfill.WeakMap.html">module:barejs/polyfill.WeakMap</a></span>
  224. </dd>
  225. </dl>
  226. </article>
  227. </section>
  228. </div>
  229. <nav>
  230. <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-barejs.html">barejs</a></li><li><a href="module-barejs_polyfill.html">barejs/polyfill</a></li><li><a href="module-barejs_polyfill_Intl.html">barejs/polyfill/Intl</a></li></ul><h3>Classes</h3><ul><li><a href="module-barejs.decl.html">decl</a></li><li><a href="module-barejs.decl-Enum.html">Enum</a></li><li><a href="module-barejs.decl-Interface.html">Interface</a></li><li><a href="module-barejs.decl-SpecialType.html">SpecialType</a></li><li><a href="module-barejs.Destroyable.html">Destroyable</a></li><li><a href="module-barejs.EventArgs.html">EventArgs</a></li><li><a href="module-barejs.Evented.html">Evented</a></li><li><a href="module-barejs.Evented-EventedHandle.html">EventedHandle</a></li><li><a href="module-barejs.Exception.html">Exception</a></li><li><a href="module-barejs_polyfill.Array.html">Array</a></li><li><a href="module-barejs_polyfill.Date.html">Date</a></li><li><a href="module-barejs_polyfill.EntryStore.html">EntryStore</a></li><li><a href="module-barejs_polyfill.EntryStore.Iterator.html">Iterator</a></li><li><a href="module-barejs_polyfill.Function.html">Function</a></li><li><a href="module-barejs_polyfill.Map.html">Map</a></li><li><a href="module-barejs_polyfill.Map-MapIterator.html">MapIterator</a></li><li><a href="module-barejs_polyfill.Math.html">Math</a></li><li><a href="module-barejs_polyfill.Number.html">Number</a></li><li><a href="module-barejs_polyfill.Object.html">Object</a></li><li><a href="module-barejs_polyfill.Promise.html">Promise</a></li><li><a href="module-barejs_polyfill.Set.html">Set</a></li><li><a href="module-barejs_polyfill.Set-SetIterator.html">SetIterator</a></li><li><a href="module-barejs_polyfill.String.html">String</a></li><li><a href="module-barejs_polyfill.Symbol.html">Symbol</a></li><li><a href="module-barejs_polyfill.WeakMap.html">WeakMap</a></li><li><a href="module-barejs_polyfill.WeakSet.html">WeakSet</a></li><li><a href="module-barejs_polyfill_Intl.DateTimeFormat.html">DateTimeFormat</a></li><li><a href="module-barejs_polyfill_Intl.DateTimeFormat-DateTimeFormatOptions.html">DateTimeFormatOptions</a></li><li><a href="module-barejs_polyfill_Intl.NumberFormat.html">NumberFormat</a></li><li><a href="module-barejs_polyfill_Intl.NumberFormat-NumberFormatOptions.html">NumberFormatOptions</a></li><li><a href="module-barejs_polyfill_Intl-Format.html">Format</a></li></ul>
  231. </nav>
  232. <br class="clear">
  233. <footer>
  234. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Oct 03 2018 15:59:34 GMT+0200 (W. Europe Daylight Time)
  235. </footer>
  236. <script> prettyPrint(); </script>
  237. <script src="scripts/linenumber.js"> </script>
  238. </body>
  239. </html>