From 751c77f87b34389c5b85a23c71080d367c42d31b Mon Sep 17 00:00:00 2001 From: Lucas Galfasó Date: Sat, 4 May 2013 21:44:14 -0300 Subject: fix(i18n): Do not transform arrays into objects Do not trasnform arrays into objects when generating the locale objects Add unit test for this check --- i18n/src/closureI18nExtractor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'i18n/src/closureI18nExtractor.js') diff --git a/i18n/src/closureI18nExtractor.js b/i18n/src/closureI18nExtractor.js index 13d42143..05e3997d 100644 --- a/i18n/src/closureI18nExtractor.js +++ b/i18n/src/closureI18nExtractor.js @@ -116,7 +116,7 @@ function canonicalizeForJsonStringify(unused_key, object) { // 2. https://code.google.com/p/v8/issues/detail?id=164 // ECMA-262 does not specify enumeration order. The de facto standard // is to match insertion order, which V8 also does ... - if (typeof object != "object") { + if (typeof object != "object" || Object.prototype.toString.apply(object) === '[object Array]') { return object; } var result = {}; -- cgit v1.2.3