From 2df1ca397139bcec0dea66fb39452fee8e5f7d7b Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 22 Dec 2014 22:07:45 +1100 Subject: [PATCH] properly freeze tagged template literal object #328 --- lib/6to5/templates/tagged-template-literal.js | 4 +++- .../transformation/es6-template-literals/tag/expected.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/6to5/templates/tagged-template-literal.js b/lib/6to5/templates/tagged-template-literal.js index a1735f0fc7..5a3a997307 100644 --- a/lib/6to5/templates/tagged-template-literal.js +++ b/lib/6to5/templates/tagged-template-literal.js @@ -1,4 +1,6 @@ (function (strings, raw) { - return Object.freeze(Object.defineProperties(strings, { raw: { value: raw } })); + return Object.freeze(Object.defineProperties(strings, { + raw: { value: Object.freeze(raw) } + })); }); diff --git a/test/fixtures/transformation/es6-template-literals/tag/expected.js b/test/fixtures/transformation/es6-template-literals/tag/expected.js index 6d6de74206..c4b5cb6cbb 100644 --- a/test/fixtures/transformation/es6-template-literals/tag/expected.js +++ b/test/fixtures/transformation/es6-template-literals/tag/expected.js @@ -3,7 +3,7 @@ var _taggedTemplateLiteral = function (strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { - value: raw + value: Object.freeze(raw) } })); };