From 9ee41e14d2d173866300e75758468c6788180277 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 29 Jun 2021 14:21:31 -0400 Subject: [PATCH] fix: prevent withAsyncContext currentInstance leak in edge cases --- .../__tests__/apiSetupHelpers.spec.ts | 185 +++++++++++++++--- packages/runtime-core/src/apiSetupHelpers.ts | 13 +- packages/runtime-core/src/component.ts | 5 + 3 files changed, 170 insertions(+), 33 deletions(-) diff --git a/packages/runtime-core/__tests__/apiSetupHelpers.spec.ts b/packages/runtime-core/__tests__/apiSetupHelpers.spec.ts index 17d4e298..cf698d7b 100644 --- a/packages/runtime-core/__tests__/apiSetupHelpers.spec.ts +++ b/packages/runtime-core/__tests__/apiSetupHelpers.spec.ts @@ -1,11 +1,13 @@ import { ComponentInternalInstance, + createApp, defineComponent, getCurrentInstance, h, nodeOps, onMounted, render, + serializeInner, SetupContext, Suspense } from '@vue/runtime-test' @@ -95,38 +97,161 @@ describe('SFC