From 69b8841967dce375856c3607dbd6d9b8aaf9fe71 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Mon, 9 Dec 2024 23:07:40 +0300 Subject: [PATCH 1/2] fix: apply freezing to template object --- tslib.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tslib.js b/tslib.js index 5e12ace..7f67637 100644 --- a/tslib.js +++ b/tslib.js @@ -303,6 +303,7 @@ var __rewriteRelativeImportExtension; __makeTemplateObject = function (cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + if (Object.freeze) { Object.freeze(cooked); Object.freeze(raw) } return cooked; }; From 9a6c805deaea665c16ed765fe89e9cdd934f53af Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Tue, 10 Dec 2024 22:47:16 +0300 Subject: [PATCH 2/2] fix: make template object `raw` value non-enumerable --- tslib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tslib.js b/tslib.js index 7f67637..5c7fb62 100644 --- a/tslib.js +++ b/tslib.js @@ -302,7 +302,7 @@ var __rewriteRelativeImportExtension; }; __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw, enumerable: false }); } else { cooked.raw = raw; } if (Object.freeze) { Object.freeze(cooked); Object.freeze(raw) } return cooked; };