Skip to content

Commit 3fe6131

Browse files
committed
Extend: Do not extend cyclical data structures, closes jquerygh-332
1 parent f82164f commit 3fe6131

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

entries/jQuery.extend.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
<p>The merge performed by <code>$.extend()</code> is not recursive by default; if a property of the first object is itself an object or array, it will be completely overwritten by a property with the same key in the second or subsequent object. The values are not merged. This can be seen in the example below by examining the value of banana. However, by passing <code>true</code> for the first function argument, objects will be recursively merged.</p>
3838
<p><strong>Warning</strong>: Passing <code>false</code> for the first argument is not supported.</p>
3939
<p>Undefined properties are not copied. However, properties inherited from the object's prototype <em>will</em> be copied over. Properties that are an object constructed via <code>new MyCustomObject(args)</code>, or built-in JavaScript types such as Date or RegExp, are not re-constructed and will appear as plain Objects in the resulting object or array.</p>
40-
<p>On a <code>deep</code> extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not.</p>
41-
<p>For needs that fall outside of this behavior, write a custom extend method instead. </p>
40+
<p>On a <code>deep</code> extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not. Deep-extending a cyclical data structure will result in an error.</p>
41+
<p>For needs that fall outside of this behavior, write a custom extend method instead, or use a library like <a href="http://lodash.com">lodash</a>. </p>
4242
</longdesc>
4343
<example>
4444
<desc>Merge two objects, modifying the first.</desc>

0 commit comments

Comments
 (0)