module-barejs_polyfill.Object.html 16 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: Object</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: Object</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>Object<span class="signature">()</span><span class="type-signature"></span></h2>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h4 class="name" id="Object"><span class="type-signature"></span>new Object<span class="signature">()</span><span class="type-signature"></span></h4>
  25. <div class="description">
  26. <p>Polyfills for <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>.
  27. Module that provides implementations for methods missing on Object. Methods that cannot be polyfilled close enough to
  28. the spec (since they rely on Native implementations) are not added to the Object global.</p>
  29. </div>
  30. <dl class="details">
  31. <dt class="tag-source">Source:</dt>
  32. <dd class="tag-source"><ul class="dummy"><li>
  33. <a href="polyfill_Object.js.html">polyfill/Object.js</a>, <a href="polyfill_Object.js.html#line29">line 29</a>
  34. </li></ul></dd>
  35. </dl>
  36. </div>
  37. <h3 class="subsection-title">Methods</h3>
  38. <h4 class="name" id=".assign"><span class="type-signature">(static) </span>assign<span class="signature">(_target, _firstSource)</span><span class="type-signature"> &rarr; {object}</span></h4>
  39. <div class="description">
  40. <p>The Object.assign() method only copies enumerable and own properties from a source object to a target object.
  41. It uses [[Get]] on the source and [[Put]] on the target, so it will invoke getters and setters.
  42. Therefore it assigns properties versus just copying or defining new properties.
  43. This may make it unsuitable for merging new properties into a prototype if the merge sources contain getters.
  44. For copying property definitions, including their enumerability, into prototypes Object.getOwnPropertyDescriptor() and Object.defineProperty() should be used instead.</p>
  45. </div>
  46. <h5>Parameters:</h5>
  47. <table class="params">
  48. <thead>
  49. <tr>
  50. <th>Name</th>
  51. <th>Type</th>
  52. <th class="last">Description</th>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. <tr>
  57. <td class="name"><code>_target</code></td>
  58. <td class="type">
  59. <span class="param-type">object</span>
  60. </td>
  61. <td class="description last"><p>The target to assign to.</p></td>
  62. </tr>
  63. <tr>
  64. <td class="name"><code>_firstSource</code></td>
  65. <td class="type">
  66. <span class="param-type">object</span>
  67. </td>
  68. <td class="description last"><p>The first source object to copy from.</p></td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <dl class="details">
  73. <dt class="tag-source">Source:</dt>
  74. <dd class="tag-source"><ul class="dummy"><li>
  75. <a href="polyfill_Object.js.html">polyfill/Object.js</a>, <a href="polyfill_Object.js.html#line703">line 703</a>
  76. </li></ul></dd>
  77. </dl>
  78. <h5>Returns:</h5>
  79. <div class="param-desc">
  80. <p>the _target, with properties assigned.</p>
  81. </div>
  82. <dl>
  83. <dt>
  84. Type
  85. </dt>
  86. <dd>
  87. <span class="param-type">object</span>
  88. </dd>
  89. </dl>
  90. <h4 class="name" id=".create"><span class="type-signature">(static) </span>create<span class="signature">(_proto, _properties)</span><span class="type-signature"> &rarr; {object}</span></h4>
  91. <div class="description">
  92. <p>Create an instance of an object that has another object as its prototype</p>
  93. </div>
  94. <h5>Parameters:</h5>
  95. <table class="params">
  96. <thead>
  97. <tr>
  98. <th>Name</th>
  99. <th>Type</th>
  100. <th class="last">Description</th>
  101. </tr>
  102. </thead>
  103. <tbody>
  104. <tr>
  105. <td class="name"><code>_proto</code></td>
  106. <td class="type">
  107. <span class="param-type">object</span>
  108. </td>
  109. <td class="description last"><p>The prototype of the newly created object, or null.</p></td>
  110. </tr>
  111. <tr>
  112. <td class="name"><code>_properties</code></td>
  113. <td class="type">
  114. <span class="param-type">object</span>
  115. </td>
  116. <td class="description last"></td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. <dl class="details">
  121. <dt class="tag-source">Source:</dt>
  122. <dd class="tag-source"><ul class="dummy"><li>
  123. <a href="polyfill_Object.js.html">polyfill/Object.js</a>, <a href="polyfill_Object.js.html#line504">line 504</a>
  124. </li></ul></dd>
  125. </dl>
  126. <h5>Returns:</h5>
  127. <div class="param-desc">
  128. <p>A new object that has the input object as prototype.</p>
  129. </div>
  130. <dl>
  131. <dt>
  132. Type
  133. </dt>
  134. <dd>
  135. <span class="param-type">object</span>
  136. </dd>
  137. </dl>
  138. <h4 class="name" id=".entries"><span class="type-signature">(static) </span>entries<span class="signature">(_target)</span><span class="type-signature"> &rarr; {Array}</span></h4>
  139. <div class="description">
  140. <p>The Object.entries() method returns an array of a given object's own enumerable property [key, value] pairs,
  141. in the same order as that provided by a for...in loop
  142. (the difference being that a for-in loop enumerates properties in the prototype chain as well).</p>
  143. </div>
  144. <h5>Parameters:</h5>
  145. <table class="params">
  146. <thead>
  147. <tr>
  148. <th>Name</th>
  149. <th>Type</th>
  150. <th class="last">Description</th>
  151. </tr>
  152. </thead>
  153. <tbody>
  154. <tr>
  155. <td class="name"><code>_target</code></td>
  156. <td class="type">
  157. <span class="param-type">object</span>
  158. </td>
  159. <td class="description last"><p>The object to enumerate.</p></td>
  160. </tr>
  161. </tbody>
  162. </table>
  163. <dl class="details">
  164. <dt class="tag-source">Source:</dt>
  165. <dd class="tag-source"><ul class="dummy"><li>
  166. <a href="polyfill_Object.js.html">polyfill/Object.js</a>, <a href="polyfill_Object.js.html#line748">line 748</a>
  167. </li></ul></dd>
  168. </dl>
  169. <h5>Returns:</h5>
  170. <div class="param-desc">
  171. <p>The array of values</p>
  172. </div>
  173. <dl>
  174. <dt>
  175. Type
  176. </dt>
  177. <dd>
  178. <span class="param-type">Array</span>
  179. </dd>
  180. </dl>
  181. <h4 class="name" id=".is"><span class="type-signature">(static) </span>is<span class="signature">(_v1, _v2)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  182. <div class="description">
  183. <p>Object.is() determines whether two values are the same value. Two values are the same if one of the following holds:</p>
  184. <ul>
  185. <li>both undefined</li>
  186. <li>both null</li>
  187. <li>both true or both false</li>
  188. <li>both strings of the same length with the same characters</li>
  189. <li>both the same object</li>
  190. <li>both numbers and</li>
  191. <li>both +0</li>
  192. <li>both -0</li>
  193. <li>both NaN</li>
  194. <li>or both non-zero and both not NaN and both have the same value</li>
  195. </ul>
  196. </div>
  197. <h5>Parameters:</h5>
  198. <table class="params">
  199. <thead>
  200. <tr>
  201. <th>Name</th>
  202. <th>Type</th>
  203. <th class="last">Description</th>
  204. </tr>
  205. </thead>
  206. <tbody>
  207. <tr>
  208. <td class="name"><code>_v1</code></td>
  209. <td class="type">
  210. </td>
  211. <td class="description last"><p>The first value to compare.</p></td>
  212. </tr>
  213. <tr>
  214. <td class="name"><code>_v2</code></td>
  215. <td class="type">
  216. </td>
  217. <td class="description last"><p>The second value to compare.</p></td>
  218. </tr>
  219. </tbody>
  220. </table>
  221. <dl class="details">
  222. <dt class="tag-source">Source:</dt>
  223. <dd class="tag-source"><ul class="dummy"><li>
  224. <a href="polyfill_Object.js.html">polyfill/Object.js</a>, <a href="polyfill_Object.js.html#line685">line 685</a>
  225. </li></ul></dd>
  226. </dl>
  227. <h5>Returns:</h5>
  228. <div class="param-desc">
  229. <p>A new object that has the input object as prototype.</p>
  230. </div>
  231. <dl>
  232. <dt>
  233. Type
  234. </dt>
  235. <dd>
  236. <span class="param-type">boolean</span>
  237. </dd>
  238. </dl>
  239. <h4 class="name" id=".keys"><span class="type-signature">(static) </span>keys<span class="signature">(_obj)</span><span class="type-signature"> &rarr; {Array}</span></h4>
  240. <div class="description">
  241. <p>Return the property names defined directly on object</p>
  242. </div>
  243. <h5>Parameters:</h5>
  244. <table class="params">
  245. <thead>
  246. <tr>
  247. <th>Name</th>
  248. <th>Type</th>
  249. <th class="last">Description</th>
  250. </tr>
  251. </thead>
  252. <tbody>
  253. <tr>
  254. <td class="name"><code>_obj</code></td>
  255. <td class="type">
  256. <span class="param-type">object</span>
  257. </td>
  258. <td class="description last"><p>The target object.</p></td>
  259. </tr>
  260. </tbody>
  261. </table>
  262. <dl class="details">
  263. <dt class="tag-source">Source:</dt>
  264. <dd class="tag-source"><ul class="dummy"><li>
  265. <a href="polyfill_Object.js.html">polyfill/Object.js</a>, <a href="polyfill_Object.js.html#line547">line 547</a>
  266. </li></ul></dd>
  267. </dl>
  268. <h5>Returns:</h5>
  269. <div class="param-desc">
  270. <p>String[] property names.</p>
  271. </div>
  272. <dl>
  273. <dt>
  274. Type
  275. </dt>
  276. <dd>
  277. <span class="param-type">Array</span>
  278. </dd>
  279. </dl>
  280. <h4 class="name" id=".values"><span class="type-signature">(static) </span>values<span class="signature">(_target)</span><span class="type-signature"> &rarr; {Array}</span></h4>
  281. <div class="description">
  282. <p>The Object.values() method returns an array of a given object's own enumerable property values,
  283. in the same order as that provided by a for...in loop
  284. (the difference being that a for-in loop enumerates properties in the prototype chain as well).</p>
  285. </div>
  286. <h5>Parameters:</h5>
  287. <table class="params">
  288. <thead>
  289. <tr>
  290. <th>Name</th>
  291. <th>Type</th>
  292. <th class="last">Description</th>
  293. </tr>
  294. </thead>
  295. <tbody>
  296. <tr>
  297. <td class="name"><code>_target</code></td>
  298. <td class="type">
  299. <span class="param-type">object</span>
  300. </td>
  301. <td class="description last"><p>The object to enumerate.</p></td>
  302. </tr>
  303. </tbody>
  304. </table>
  305. <dl class="details">
  306. <dt class="tag-source">Source:</dt>
  307. <dd class="tag-source"><ul class="dummy"><li>
  308. <a href="polyfill_Object.js.html">polyfill/Object.js</a>, <a href="polyfill_Object.js.html#line733">line 733</a>
  309. </li></ul></dd>
  310. </dl>
  311. <h5>Returns:</h5>
  312. <div class="param-desc">
  313. <p>The array of values</p>
  314. </div>
  315. <dl>
  316. <dt>
  317. Type
  318. </dt>
  319. <dd>
  320. <span class="param-type">Array</span>
  321. </dd>
  322. </dl>
  323. </article>
  324. </section>
  325. </div>
  326. <nav>
  327. <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>
  328. </nav>
  329. <br class="clear">
  330. <footer>
  331. 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)
  332. </footer>
  333. <script> prettyPrint(); </script>
  334. <script src="scripts/linenumber.js"> </script>
  335. </body>
  336. </html>