From 51edfed6ed3ded44e11e47506ee4e3a23e63b192 Mon Sep 17 00:00:00 2001 From: Dave Lage Date: Wed, 7 Jul 2021 15:12:55 -0400 Subject: [PATCH 1/3] fix: fabric.Object._fromObject should never return --- src/shapes/polygon.class.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shapes/polygon.class.js b/src/shapes/polygon.class.js index b84663d2860..4a2a417b1d7 100644 --- a/src/shapes/polygon.class.js +++ b/src/shapes/polygon.class.js @@ -74,7 +74,7 @@ * @param {Function} [callback] Callback to invoke when an fabric.Path instance is created */ fabric.Polygon.fromObject = function(object, callback) { - return fabric.Object._fromObject('Polygon', object, callback, 'points'); + fabric.Object._fromObject('Polygon', object, callback, 'points'); }; })(typeof exports !== 'undefined' ? exports : this); From 6ef315d913d16ea33874e07713765960ad981bac Mon Sep 17 00:00:00 2001 From: rockerBOO Date: Wed, 7 Jul 2021 15:24:54 -0400 Subject: [PATCH 2/3] fix(shapes): fabric.Object._fromObject never should return --- src/shapes/circle.class.js | 4 ++-- src/shapes/ellipse.class.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shapes/circle.class.js b/src/shapes/circle.class.js index a43094dd5f9..030280bd526 100644 --- a/src/shapes/circle.class.js +++ b/src/shapes/circle.class.js @@ -198,10 +198,10 @@ * @memberOf fabric.Circle * @param {Object} object Object to create an instance from * @param {function} [callback] invoked with new instance as first argument - * @return {Object} Instance of fabric.Circle + * @return {void} */ fabric.Circle.fromObject = function(object, callback) { - return fabric.Object._fromObject('Circle', object, callback); + fabric.Object._fromObject('Circle', object, callback); }; })(typeof exports !== 'undefined' ? exports : this); diff --git a/src/shapes/ellipse.class.js b/src/shapes/ellipse.class.js index bad5c55dbba..d4b2e48bc67 100644 --- a/src/shapes/ellipse.class.js +++ b/src/shapes/ellipse.class.js @@ -172,10 +172,10 @@ * @memberOf fabric.Ellipse * @param {Object} object Object to create an instance from * @param {function} [callback] invoked with new instance as first argument - * @return {fabric.Ellipse} + * @return {void} */ fabric.Ellipse.fromObject = function(object, callback) { - return fabric.Object._fromObject('Ellipse', object, callback); + fabric.Object._fromObject('Ellipse', object, callback); }; })(typeof exports !== 'undefined' ? exports : this); From b7fdf170eaf5d06acfe4f763e71d939ed3ebe0b7 Mon Sep 17 00:00:00 2001 From: Dave Lage Date: Fri, 16 Jul 2021 09:51:15 -0400 Subject: [PATCH 3/3] Add return void documentation to fabric.Polygon --- src/shapes/polygon.class.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shapes/polygon.class.js b/src/shapes/polygon.class.js index 4a2a417b1d7..e03f955a15f 100644 --- a/src/shapes/polygon.class.js +++ b/src/shapes/polygon.class.js @@ -72,6 +72,7 @@ * @memberOf fabric.Polygon * @param {Object} object Object to create an instance from * @param {Function} [callback] Callback to invoke when an fabric.Path instance is created + * @return {void} */ fabric.Polygon.fromObject = function(object, callback) { fabric.Object._fromObject('Polygon', object, callback, 'points');