Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not mutate passed object to fromObject #4699

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
do not mutate passed object to fromObject
  • Loading branch information
Stefan Hayden committed Feb 9, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit cd7d43e1cd793c3c2a0d485f8ec24c027a8de468
3 changes: 2 additions & 1 deletion src/shapes/image.class.js
Original file line number Diff line number Diff line change
@@ -630,7 +630,8 @@
* @param {Object} object Object to create an instance from
* @param {Function} callback Callback to invoke when an image instance is created
*/
fabric.Image.fromObject = function(object, callback) {
fabric.Image.fromObject = function(_object, callback) {
var object = fabric.util.object.clone(_object);
fabric.util.loadImage(object.src, function(img, error) {
if (error) {
callback && callback(null, error);