From 356b9e4495b4d71a1ea46288d2a4d44696b3281c Mon Sep 17 00:00:00 2001 From: Shigma <1700011071@pku.edu.cn> Date: Sun, 13 Sep 2020 15:15:50 +0800 Subject: [PATCH] feat(core): use define for private session properties --- packages/koishi-core/src/session.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/koishi-core/src/session.ts b/packages/koishi-core/src/session.ts index 17acdc01fe..8f5dee7bc4 100644 --- a/packages/koishi-core/src/session.ts +++ b/packages/koishi-core/src/session.ts @@ -85,11 +85,13 @@ export class Session void)[] = [] + private _queued: Promise + private _hooks: (() => void)[] constructor(app: App, session: Partial) { defineProperty(this, '$app', app) + defineProperty(this, '_queued', Promise.resolve()) + defineProperty(this, '_hooks', []) Object.assign(this, session) }