From 7e1f710ac07c98776ef7d03c43eb5395aa01a4c0 Mon Sep 17 00:00:00 2001 From: Bill Schaller Date: Wed, 8 Mar 2017 14:03:30 -0500 Subject: [PATCH] [Easy] Don't enumerate momentProperties with 'in' Because of the way many polyfill libraries modify Array.prototype (without Object.defineProperty), enumerating momentProperties with for...in is unsafe. This is a zero-cost change that makes this enumeration safe. --- src/lib/moment/constructor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/moment/constructor.js b/src/lib/moment/constructor.js index 83f83effe..bc53f814f 100644 --- a/src/lib/moment/constructor.js +++ b/src/lib/moment/constructor.js @@ -42,7 +42,7 @@ export function copyConfig(to, from) { } if (momentProperties.length > 0) { - for (i in momentProperties) { + for (i = 0; i < momentProperties.length; i++) { prop = momentProperties[i]; val = from[prop]; if (!isUndefined(val)) { -- 2.47.2