diff --git a/lib/6to5/templates/tagged-template-literal.js b/lib/6to5/templates/tagged-template-literal.js index 9d3b26a3b7..a1735f0fc7 100644 --- a/lib/6to5/templates/tagged-template-literal.js +++ b/lib/6to5/templates/tagged-template-literal.js @@ -1,4 +1,4 @@ (function (strings, raw) { - return Object.defineProperties(strings, { raw: { value: raw } }); + return Object.freeze(Object.defineProperties(strings, { raw: { value: raw } })); }); diff --git a/test/fixtures/transformation/es6-template-literals/tag/expected.js b/test/fixtures/transformation/es6-template-literals/tag/expected.js index 9992ad8f15..6d6de74206 100644 --- a/test/fixtures/transformation/es6-template-literals/tag/expected.js +++ b/test/fixtures/transformation/es6-template-literals/tag/expected.js @@ -1,11 +1,11 @@ "use strict"; var _taggedTemplateLiteral = function (strings, raw) { - return Object.defineProperties(strings, { + return Object.freeze(Object.defineProperties(strings, { raw: { value: raw } - }); + })); }; var foo = bar(_taggedTemplateLiteral(["wow\na", "b ", ""], ["wow\\na", "b ", ""]), 42, _.foobar());