From 8cfef1a55d08aaf812ae585027814d3faff289ca Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 18 Jan 2024 09:17:42 +0800 Subject: [PATCH] Merge pull request #25634 from storybookjs/dannyhw/fix-acornparser-warning React: Fix acorn ecma version warning (cherry picked from commit 5acb52e7d6f3f05234d6075e8a87af54853adb1b) --- code/renderers/react/src/docs/lib/inspection/acornParser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/renderers/react/src/docs/lib/inspection/acornParser.ts b/code/renderers/react/src/docs/lib/inspection/acornParser.ts index 75be3aafb34c..ce62510430b8 100644 --- a/code/renderers/react/src/docs/lib/inspection/acornParser.ts +++ b/code/renderers/react/src/docs/lib/inspection/acornParser.ts @@ -206,7 +206,7 @@ function parseExpression(expression: any): ParsingResult } export function parse(value: string): ParsingResult { - const ast = acornParser.parse(`(${value})`) as unknown as estree.Program; + const ast = acornParser.parse(`(${value})`, { ecmaVersion: 2020 }) as unknown as estree.Program; let parsingResult: ParsingResult = { inferredType: { type: InspectionType.UNKNOWN },