bito-code-review[bot] commented on code in PR #44148:
URL: https://github.com/apache/superset/pull/44148#discussion_r4140999816
##########
superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts:
##########
@@ -178,6 +182,11 @@ function CountryMap(element: HTMLElement, props:
CountryMapProps) {
// Track mouse position to distinguish clicks from drags
let mousedownPos: { x: number; y: number } | null = null;
+ const sourceValue = (code: string) =>
+ sourceValues && Object.prototype.hasOwnProperty.call(sourceValues, code)
+ ? sourceValues[code]
Review Comment:
<!-- Bito Reply -->
The suggestion provided by the reviewer is a valid hardening measure to
address linter concerns regarding dynamic key access. However, as you have
correctly identified, the existing implementation already includes a robust
guard using `Object.prototype.hasOwnProperty.call`, which effectively prevents
prototype pollution in this context. Given that the current approach is safe
and the proposed conversion to `Map` would require unnecessary refactoring of
the data producer and tests, maintaining the current implementation is
acceptable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]