freeze tagged template literal object - fixes #328
This commit is contained in:
parent
4ea425ac7b
commit
bc914e6f23
@ -1,4 +1,4 @@
|
|||||||
(function (strings, raw) {
|
(function (strings, raw) {
|
||||||
return Object.defineProperties(strings, { raw: { value: raw } });
|
return Object.freeze(Object.defineProperties(strings, { raw: { value: raw } }));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var _taggedTemplateLiteral = function (strings, raw) {
|
var _taggedTemplateLiteral = function (strings, raw) {
|
||||||
return Object.defineProperties(strings, {
|
return Object.freeze(Object.defineProperties(strings, {
|
||||||
raw: {
|
raw: {
|
||||||
value: raw
|
value: raw
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
var foo = bar(_taggedTemplateLiteral(["wow\na", "b ", ""], ["wow\\na", "b ", ""]), 42, _.foobar());
|
var foo = bar(_taggedTemplateLiteral(["wow\na", "b ", ""], ["wow\\na", "b ", ""]), 42, _.foobar());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user