From b3d7a038d774d823ef861b76fb8bfa22e60a3df5 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/spec/closureI18nExtractorSpec.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'i18n/spec') diff --git a/i18n/spec/closureI18nExtractorSpec.js b/i18n/spec/closureI18nExtractorSpec.js index 87a9d455..f1455963 100644 --- a/i18n/spec/closureI18nExtractorSpec.js +++ b/i18n/spec/closureI18nExtractorSpec.js @@ -257,5 +257,10 @@ describe("serializeContent", function() { var serializedContent = closureI18nExtractor.serializeContent(newTestLocaleInfo()); expect((/[^\u0001-\u007f]/).test(serializedContent)).toBe(false); }); + it("should not transform arrays into objects", function() { + var serializedContent = closureI18nExtractor.serializeContent(newTestLocaleInfo().fr_CA); + var deserializedLocale = eval("(" + serializedContent + ")"); + expect(deserializedLocale.DATETIME_FORMATS.MONTH.length).not.toBe(undefined); + }); }); -- cgit v1.2.3