mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-13 22:00:59 -05:00
Have __makeTemplateObject freeze template strings objects if possible.
This commit is contained in:
committed by
GitHub
parent
a77a79fe4b
commit
9c00001a26
@@ -663,7 +663,12 @@ export const templateObjectHelper: UnscopedEmitHelper = {
|
||||
priority: 0,
|
||||
text: `
|
||||
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
if (Object.freeze) {
|
||||
Object.freeze(Object.defineProperty(cooked, "raw", { value: Object.freeze(raw) }));
|
||||
}
|
||||
else {
|
||||
cooked.raw = raw;
|
||||
}
|
||||
return cooked;
|
||||
};`
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user