This is an automated email from the ASF dual-hosted git repository. plainheart pushed a commit to branch fix/geojson-parse in repository https://gitbox.apache.org/repos/asf/echarts.git
commit 0cc409e0a33360199a25a49a3c8b1cd98987ced3 Author: plainheart <[email protected]> AuthorDate: Sun May 31 16:49:41 2026 +0800 fix(geo): fix `GeoJSONResource.parseInput` - remove unsafe and unnecessary `new Function` --- src/coord/geo/GeoJSONResource.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/coord/geo/GeoJSONResource.ts b/src/coord/geo/GeoJSONResource.ts index 93a1d7123..14f659097 100644 --- a/src/coord/geo/GeoJSONResource.ts +++ b/src/coord/geo/GeoJSONResource.ts @@ -161,9 +161,5 @@ function calculateBoundingRect(regions: GeoJSONRegion[]): BoundingRect { } function parseInput(source: GeoJSONSourceInput): GeoJSON | GeoJSONCompressed { - return !isString(source) - ? source - : (typeof JSON !== 'undefined' && JSON.parse) - ? JSON.parse(source) - : (new Function('return (' + source + ');'))(); + return !isString(source) ? source : JSON.parse(source); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
