Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit 88e39ad

Browse files
stevenjobhzoo
authored andcommitted
Now using template strings (#410)
* Use template strings in non-regression tests * Refactor non-regression tests to fix test failures Moved backtick to fix test 'getter/setter #218' as indent matters Fixed line numbers for some tests * Use template strings in babel-eslint tests * Fix tests for babel-eslint Avoids error that shows when using template strings for tests: line 253 line comments line 260 block comments line 306 jsdoc Error: At loc.start.column: are different (6 !== 0) * Other small template literal changes * Add unpad to correctly indent template literals
1 parent 11ac658 commit 88e39ad

File tree

7 files changed

+776
-702
lines changed

7 files changed

+776
-702
lines changed

babylon-to-espree/toAST.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ var astTransformVisitor = {
160160
}
161161

162162
if (path.isRestProperty() || path.isSpreadProperty()) {
163-
node.type = "Experimental" + node.type;
163+
node.type = `Experimental${node.type}`;
164164
}
165165

166166
if (path.isTypeParameter && path.isTypeParameter()) {

babylon-to-espree/toToken.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module.exports = function (token, tt, source) {
5353
pattern: value.pattern,
5454
flags: value.flags
5555
};
56-
token.value = "/" + value.pattern + "/" + value.flags;
56+
token.value = `/${value.pattern}/${value.flags}`;
5757
}
5858

5959
return token;

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ exports.parseNoPatch = function (code, options) {
396396
err.column = err.loc.column + 1;
397397

398398
// remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start
399-
err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, "");
399+
err.message = `Line ${err.lineNumber}: ${err.message.replace(/ \((\d+):(\d+)\)$/, "")}`;
400400
}
401401

402402
throw err;

0 commit comments

Comments
 (0)