plainheart commented on code in PR #19217:
URL: https://github.com/apache/echarts/pull/19217#discussion_r1362951996
##########
src/core/echarts.ts:
##########
@@ -418,11 +418,11 @@ class ECharts extends Eventful<ECEventDefinition> {
env.hasGlobalWindow ? window : global
) as any;
- defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ ||
defaultRenderer;
+ defaultRenderer = root?.__ECHARTS__DEFAULT__RENDERER__ ??
defaultRenderer;
Review Comment:
As the build target of ECharts is currently still `ES3`, to reduce the
transpiled code size as possible, instead of `?.` and `??`, just fallback
`root` to `{}` when it is not defined or simply surround the block (line 421-
line 428) with `if(root) {}`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]