From 53357bda5fc898c31a99ab0e6b60600bc43e5896 Mon Sep 17 00:00:00 2001 From: ufec Date: Thu, 17 Aug 2023 22:37:52 +0800 Subject: [PATCH] fix: #387 CherryEngine TypeError --- src/Cherry.js | 3 +-- src/index.engine.core.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Cherry.js b/src/Cherry.js index b0493c7f6..36fc535df 100644 --- a/src/Cherry.js +++ b/src/Cherry.js @@ -92,8 +92,7 @@ export default class Cherry extends CherryStatic { this.options.instanceId = this.instanceId; /** - * @private - * @type {Engine} + * @type {import('./Engine').default} */ this.engine = new Engine(this.options, this); this.init(); diff --git a/src/index.engine.core.js b/src/index.engine.core.js index e28e18801..912ccd0b4 100644 --- a/src/index.engine.core.js +++ b/src/index.engine.core.js @@ -51,9 +51,9 @@ class CherryEngine extends CherryStatic { opts.engine.global.urlProcessor = urlProcessorProxy(opts.engine.global.urlProcessor); } + /** @type {import('./Engine').default}*/ // @ts-ignore hack Cherry Instance - const $engine = new Engine(opts, { options: opts }); - return $engine; + this.engine = new Engine(opts, { options: opts }); } }