pissang commented on a change in pull request #12943:
URL: 
https://github.com/apache/incubator-echarts/pull/12943#discussion_r454294499



##########
File path: src/coord/radar/RadarModel.ts
##########
@@ -151,11 +151,9 @@ class RadarModel extends ComponentModel<RadarOption> 
implements CoordinateSystem
                     innerIndicatorOpt.name, innerIndicatorOpt
                 );
             }
-            const model = zrUtil.extend(
-                new Model(innerIndicatorOpt, null, this.ecModel),
-                AxisModelCommonMixin.prototype
-            ) as AxisBaseModel<InnerIndicatorAxisOption>;
 
+            mixinAxisModelCommonMethods(Model);
+            const model = new Model(innerIndicatorOpt, null, this.ecModel) as 
AxisBaseModel<InnerIndicatorAxisOption>;

Review comment:
       It's dangerous to mixin the methods to the Mode.prototype. It will 
affect all the models.
   
   It seems the error is caused because the prototype in the native ES6 class 
is not iterable. We did a workaround in the mixin method 
https://github.com/ecomfe/zrender/blob/next/src/core/util.ts#L257
   
   In this case, I think it's better to extend a new Model class, like:
   ```js
   class RadarIndicatorModel extends Model {};
   mixinAxisModelCommonMethods(RadarIndicatorModel);
   ```
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to