Skip to content

Commit 464dde8

Browse files
authored
fix(Angular): deprecate angular.merge
This function has problems with special object types but since it's not used in core, it is not worth implementing fixes for these cases. A general purpose library like lodash (provides `merge`) should be used instead. Closes angular#12653 Closes angular#14941 Closes angular#15180 Closes angular#15992 Closes angular#16036
1 parent 42299e9 commit 464dde8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Angular.js

+14
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,20 @@ function extend(dst) {
421421
* Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source
422422
* objects, performing a deep copy.
423423
*
424+
* @deprecated
425+
* sinceVersion="1.6.5"
426+
* This function is deprecated, but will not be removed in the 1.x lifecycle.
427+
* There are edge cases (see {@link angular.merge#known-issues known issues}) that are not
428+
* supported by this function. We suggest
429+
* using [lodash's merge()](https://lodash.com/docs/4.17.4#merge) instead.
430+
*
431+
* @knownIssue
432+
* This is a list of (known) object types that are not handled correctly by this function:
433+
* - [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob)
434+
* - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)
435+
* - [`CanvasGradient`](https://developer.mozilla.org/docs/Web/API/CanvasGradient)
436+
* - AngularJS {@link $rootScope.Scope scopes};
437+
*
424438
* @param {Object} dst Destination object.
425439
* @param {...Object} src Source object(s).
426440
* @returns {Object} Reference to `dst`.

0 commit comments

Comments
 (0)