Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit dc41f46

Browse files
committed
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 #12653 Closes #14941 Closes #15180 Closes #15992 Closes #16036
1 parent 6e3b5a5 commit dc41f46

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
@@ -437,6 +437,20 @@ function extend(dst) {
437437
* Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source
438438
* objects, performing a deep copy.
439439
*
440+
* @deprecated
441+
* sinceVersion="1.6.5"
442+
* This function is deprecated, but will not be removed in the 1.x lifecycle.
443+
* There are edge cases (see {@link angular.merge#known-issues known issues}) that are not
444+
* supported by this function. We suggest
445+
* using [lodash's merge()](https://lodash.com/docs/4.17.4#merge) instead.
446+
*
447+
* @knownIssue
448+
* This is a list of (known) object types that are not handled correctly by this function:
449+
* - [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob)
450+
* - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)
451+
* - [`CanvasGradient`](https://developer.mozilla.org/docs/Web/API/CanvasGradient)
452+
* - AngularJS {@link $rootScope.Scope scopes};
453+
*
440454
* @param {Object} dst Destination object.
441455
* @param {...Object} src Source object(s).
442456
* @returns {Object} Reference to `dst`.

0 commit comments

Comments
 (0)