From c36c4fde4f66ff1af197a86eb400ac40f4962b3e Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Fri, 16 Jun 2023 15:33:27 +0300 Subject: [PATCH] fix: make locals enumerable --- packages/astro/src/core/endpoint/index.ts | 1 + packages/astro/src/core/render/context.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/astro/src/core/endpoint/index.ts b/packages/astro/src/core/endpoint/index.ts index 5822685cf987..9bbfbc4cd883 100644 --- a/packages/astro/src/core/endpoint/index.ts +++ b/packages/astro/src/core/endpoint/index.ts @@ -78,6 +78,7 @@ export function createAPIContext({ // We define a custom property, so we can check the value passed to locals Object.defineProperty(context, 'locals', { + enumerable: true, get() { return Reflect.get(request, clientLocalsSymbol); }, diff --git a/packages/astro/src/core/render/context.ts b/packages/astro/src/core/render/context.ts index eba81526e978..a43650a556cb 100644 --- a/packages/astro/src/core/render/context.ts +++ b/packages/astro/src/core/render/context.ts @@ -67,6 +67,7 @@ export async function createRenderContext( // We define a custom property, so we can check the value passed to locals Object.defineProperty(context, 'locals', { + enumerable: true, get() { return Reflect.get(request, clientLocalsSymbol); },