From 4840db67caeffc4fe38326a5a38a8c89dbf9b06f Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Wed, 5 Jul 2017 16:31:50 -0500 Subject: [PATCH] fix: adds a hasOwnProperty check, uses "let". --- modules/analytics/analytics.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/analytics/analytics.js b/modules/analytics/analytics.js index 2a495052f..25007e410 100644 --- a/modules/analytics/analytics.js +++ b/modules/analytics/analytics.js @@ -125,8 +125,11 @@ class Analytics { // optionally include local deployment information based on // the contents of window.config.deploymentInfo if (config.deploymentInfo) { - for (var key in config.deploymentInfo) { - permanentProperties[key] = config.deploymentInfo[key]; + for (let key in config.deploymentInfo) { + if (config.deploymentInfo.hasOwnProperty(key)) { + permanentProperties[key] + = config.deploymentInfo[key]; + } } }