Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for template literals revision #5523

Merged
merged 4 commits into from
Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/babel-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"babel-register": "7.0.0-alpha.2",
"babel-traverse": "7.0.0-alpha.1",
"babel-types": "7.0.0-alpha.1",
"babylon": "7.0.0-beta.6",
"babylon": "7.0.0-beta.7",
"convert-source-map": "^1.1.0",
"debug": "^2.1.1",
"json5": "^0.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
},
"devDependencies": {
"babel-helper-fixtures": "7.0.0-alpha.1",
"babylon": "7.0.0-beta.4"
"babylon": "7.0.0-beta.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ html`<b></b>`;
asdf
awer
erqer`;

tag`\unicode and \u{55}`;
tag`\01`;
tag`\xg${0}right`;
tag`left${0}\xg`;
tag`left${0}\xg${1}right`;
tag`left${0}\u000g${1}right`;
tag`left${0}\u{-0}${1}right`;
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ html`<b></b>`;
asdf
awer
erqer`;

tag`\unicode and \u{55}`;
tag`\01`;
tag`\xg${0}right`;
tag`left${0}\xg`;
tag`left${0}\xg${1}right`;
tag`left${0}\u000g${1}right`;
tag`left${0}\u{-0}${1}right`;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export default function ({ types: t }) {
let raw = [];

for (const elem of (quasi.quasis: Array)) {
strings.push(t.stringLiteral(elem.value.cooked));
const value = elem.value.cooked == null
? path.scope.buildUndefinedNode()
: t.stringLiteral(elem.value.cooked);
strings.push(value);
raw.push(t.stringLiteral(elem.value.raw));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
tag`\unicode and \u{55}`;

tag`\01`;
tag`\xg${0}right`;
tag`left${0}\xg`;
tag`left${0}\xg${1}right`;
tag`left${0}\u000g${1}right`;
tag`left${0}\u{-0}${1}right`;

function a() {
var undefined = 4;
tag`\01`;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var _templateObject = _taggedTemplateLiteralLoose([void 0], ["\\unicode and \\u{55}"]),
_templateObject2 = _taggedTemplateLiteralLoose([void 0], ["\\01"]),
_templateObject3 = _taggedTemplateLiteralLoose([void 0, "right"], ["\\xg", "right"]),
_templateObject4 = _taggedTemplateLiteralLoose(["left", void 0], ["left", "\\xg"]),
_templateObject5 = _taggedTemplateLiteralLoose(["left", void 0, "right"], ["left", "\\xg", "right"]),
_templateObject6 = _taggedTemplateLiteralLoose(["left", void 0, "right"], ["left", "\\u000g", "right"]),
_templateObject7 = _taggedTemplateLiteralLoose(["left", void 0, "right"], ["left", "\\u{-0}", "right"]);

function _taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; }

tag(_templateObject);

tag(_templateObject2);
tag(_templateObject3, 0);
tag(_templateObject4, 0);
tag(_templateObject5, 0, 1);
tag(_templateObject6, 0, 1);
tag(_templateObject7, 0, 1);

function a() {
var undefined = 4;
tag(_templateObject2);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": [["transform-es2015-template-literals", { "loose": true }]]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
tag`\unicode and \u{55}`;

tag`\01`;
tag`\xg${0}right`;
tag`left${0}\xg`;
tag`left${0}\xg${1}right`;
tag`left${0}\u000g${1}right`;
tag`left${0}\u{-0}${1}right`;

function a() {
var undefined = 4;
tag`\01`;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var _templateObject = _taggedTemplateLiteral([void 0], ["\\unicode and \\u{55}"]),
_templateObject2 = _taggedTemplateLiteral([void 0], ["\\01"]),
_templateObject3 = _taggedTemplateLiteral([void 0, "right"], ["\\xg", "right"]),
_templateObject4 = _taggedTemplateLiteral(["left", void 0], ["left", "\\xg"]),
_templateObject5 = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\xg", "right"]),
_templateObject6 = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u000g", "right"]),
_templateObject7 = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u{-0}", "right"]);

function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

tag(_templateObject);

tag(_templateObject2);
tag(_templateObject3, 0);
tag(_templateObject4, 0);
tag(_templateObject5, 0, 1);
tag(_templateObject6, 0, 1);
tag(_templateObject7, 0, 1);

function a() {
var undefined = 4;
tag(_templateObject2);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
tag`\unicode and \u{55}`;

tag`\01`;
tag`\xg${0}right`;
tag`left${0}\xg`;
tag`left${0}\xg${1}right`;
tag`left${0}\u000g${1}right`;
tag`left${0}\u{-0}${1}right`;

function a() {
var undefined = 4;
tag`\01`;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var _templateObject = _taggedTemplateLiteral([void 0], ["\\unicode and \\u{55}"]),
_templateObject2 = _taggedTemplateLiteral([void 0], ["\\01"]),
_templateObject3 = _taggedTemplateLiteral([void 0, "right"], ["\\xg", "right"]),
_templateObject4 = _taggedTemplateLiteral(["left", void 0], ["left", "\\xg"]),
_templateObject5 = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\xg", "right"]),
_templateObject6 = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u000g", "right"]),
_templateObject7 = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u{-0}", "right"]);

function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

tag(_templateObject);

tag(_templateObject2);
tag(_templateObject3, 0);
tag(_templateObject4, 0);
tag(_templateObject5, 0, 1);
tag(_templateObject6, 0, 1);
tag(_templateObject7, 0, 1);

function a() {
var undefined = 4;
tag(_templateObject2);
}
2 changes: 1 addition & 1 deletion packages/babel-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"repository": "https://github.com/babel/babel/tree/master/packages/babel-template",
"main": "lib/index.js",
"dependencies": {
"babylon": "7.0.0-beta.6",
"babylon": "7.0.0-beta.7",
"babel-traverse": "7.0.0-alpha.1",
"babel-types": "7.0.0-alpha.1",
"lodash": "^4.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-traverse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"babel-code-frame": "7.0.0-alpha.1",
"babel-messages": "7.0.0-alpha.1",
"babel-types": "7.0.0-alpha.1",
"babylon": "7.0.0-beta.6",
"babylon": "7.0.0-beta.7",
"debug": "^2.2.0",
"globals": "^9.0.0",
"invariant": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"to-fast-properties": "^1.0.1"
},
"devDependencies": {
"babylon": "7.0.0-beta.4"
"babylon": "7.0.0-beta.7"
}
}