support raw property on tagged template literals - closes #164

This commit is contained in:
Sebastian McKenzie
2014-11-15 03:00:53 +11:00
parent 85c2de57e4
commit 9fb8a80f60
5 changed files with 31 additions and 9 deletions

View File

@@ -1 +1 @@
var foo = bar`a${ 42 }b ${_.foobar()}`;
var foo = bar`wow\na${ 42 }b ${_.foobar()}`;

View File

@@ -1,3 +1,11 @@
"use strict";
var foo = bar(["a", "b ", ""], 42, _.foobar());
var _taggedTemplateLiteral = function (strings, raw) {
return Object.defineProperties(strings, {
raw: {
value: raw
}
});
};
var foo = bar(_taggedTemplateLiteral(["wow\na", "b ", ""], ["wow\\na", "b ", ""]), 42, _.foobar());