Skip to content

Commit 81c4cd1

Browse files
committed
docs(angular.copy): list object types / features that are not supported
Closes angular#5085 Closes angular#13193 Closes angular#14352 Closes angular#15904 Closes angular#16055 Closes angular#16061 Closes angular#16067
1 parent dcdcb33 commit 81c4cd1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Angular.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,9 @@ function arrayRemove(array, value) {
783783
* @kind function
784784
*
785785
* @description
786-
* Creates a deep copy of `source`, which should be an object or an array.
786+
* Creates a deep copy of `source`, which should be an object or an array. This functions is used
787+
* internally, mostly in the change-detection code. It is not intended as an all-purpose copy
788+
* functions, and has several limitations (see below).
787789
*
788790
* * If no destination is supplied, a copy of the object or array is created.
789791
* * If a destination is provided, all of its elements (for arrays) or properties (for objects)
@@ -803,6 +805,16 @@ function arrayRemove(array, value) {
803805
* developers responsibility to make sure they are compatible.
804806
* </div>
805807
*
808+
* @knownIssue
809+
* This is a list of (known) object types / features that are not handled correctly by this function:
810+
* - [`ImageData`](https://developer.mozilla.org/docs/Web/API/File)
811+
* - [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)
812+
* - [`ImageData`](https://developer.mozilla.org/docs/Web/API/ImageData)
813+
* - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)
814+
* - [`WeakMap`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap)
815+
* - ['getter'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get)/
816+
* [`setter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set)`
817+
*
806818
* @param {*} source The source that will be used to make a copy. Can be any type, including
807819
* primitives, `null`, and `undefined`.
808820
* @param {(Object|Array)=} destination Destination into which the source is copied. If provided,

0 commit comments

Comments
 (0)