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

angular.merge should copy Blob like Object.assign #15992

Closed
@krulik

Description

@krulik

I'm submitting a ...

  • bug report
  • feature request
  • other (Please do not submit support requests here (see above))

Current behavior:

angular.merge doesn't copy Blob objects from source to destination.
The property is copied but the value is no longer a Blob object but an empty Object.

Expected / new behavior:

The expected behaviour would be to copy the Blob as is from source to destination.
Object.assign behaves this way (doesn't have this bug).

Minimal reproduction of the problem with instructions:

var aFileParts = ['<a id="a"><b id="b">hey!</b></a>']; // an array consisting of a single DOMString
var oMyBlob = new Blob(aFileParts, {type : 'text/html'}); // the blob
var obj1 = {blob: oMyBlob, foo: 1};
var obj2 = angular.merge({}, obj1, {foo: 2});
var obj3 = Object.assign({}, obj1, {foo: 2});
console.assert(obj2.blob instanceof Blob === obj3.blob instanceof Blob, 'angular.merge should copy Blobs like Object.assign');

Angular version: 1.6.1

Browser: [Chrome 57 Mac OS X El Capitan ]

Anything else:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions