Skip to content

Commit

Permalink
fix(Angular): deprecate angular.merge
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Narretz committed Jun 6, 2017
1 parent 7673ca7 commit 91524e6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,20 @@ function extend(dst) {
* Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source
* objects, performing a deep copy.
*
* @deprecated
* sinceVersion="1.7.0"
* This function is deprecated, but will not be removed in the 1.x lifecycle.
* There are a edge cases (see {@link angular.merge#known-issues known issues}) that are not
* supported by this function. We suggest
* using [lodash's merge()](https://lodash.com/docs/4.17.4#merge) instead.
*
* @knownIssue
* This is a list of (known) object types that cannot be / are incorrectly handled by this function:
* - [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob)
* - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)
* - [`CanvasGradient`](https://developer.mozilla.org/docs/Web/API/CanvasGradient)
* - AngularJS {@link $rootScope.Scope scopes};
*
* @param {Object} dst Destination object.
* @param {...Object} src Source object(s).
* @returns {Object} Reference to `dst`.
Expand Down

0 comments on commit 91524e6

Please sign in to comment.