chore: use `hasGlobalWindow` constant from env util.
diff --git a/src/core/echarts.ts b/src/core/echarts.ts
index 8a42838..e84c1c8 100644
--- a/src/core/echarts.ts
+++ b/src/core/echarts.ts
@@ -137,8 +137,6 @@
type ModelFinder = modelUtil.ModelFinder;
-const hasWindow = typeof window !== 'undefined';
-
export const version = '5.4.0';
export const dependencies = {
@@ -417,7 +415,7 @@
if (__DEV__) {
const root = (
/* eslint-disable-next-line */
- hasWindow ? window : global
+ env.hasGlobalWindow ? window : global
) as any;
defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;
@@ -705,7 +703,7 @@
getDevicePixelRatio(): number {
return (this._zr.painter as CanvasPainter).dpr
/* eslint-disable-next-line */
- || (hasWindow && window.devicePixelRatio) || 1;
+ || (env.hasGlobalWindow && window.devicePixelRatio) || 1;
}
/**