0.14.1 Temporary fix for wrong esprima template-literal parsing

This commit is contained in:
sanex3339
2018-02-13 23:02:19 +03:00
parent a8c4660875
commit 1bb521b773
7 changed files with 58 additions and 9555 deletions
@@ -48,7 +48,7 @@ describe('TemplateLiteralTransformer', () => {
}
);
assert.match(obfuscationResult.getObfuscatedCode(), /return *'foo\\x0abar';$/);
assert.match(obfuscationResult.getObfuscatedCode(), /{ *return *'foo\\x0abar'; *}$/);
});
it('variant #3: should transform es6 multiline template literal inside return statement', () => {
@@ -61,7 +61,7 @@ describe('TemplateLiteralTransformer', () => {
}
);
assert.match(obfuscationResult.getObfuscatedCode(), /return *'foo\\x0abar';$/);
assert.match(obfuscationResult.getObfuscatedCode(), /case *!!\[] *: *return *'foo\\x0abar'; *} *}$/);
});
});
@@ -294,7 +294,7 @@ describe('NodeUtils', () => {
});
});
describe('getNextSiblingStatementNode (node: ESTree.Statement): ESTree.Node | null', () => {
describe('getNextSiblingStatementNode (node: ESTree.Statement): TStatement | null', () => {
describe('variant #1: block statement node as scope node', () => {
let statementNode1: ESTree.Statement,
statementNode2: ESTree.Statement,
@@ -379,7 +379,7 @@ describe('NodeUtils', () => {
});
});
describe('getPreviousSiblingStatementNode (node: ESTree.Statement): ESTree.Node | null', () => {
describe('getPreviousSiblingStatementNode (node: ESTree.Statement): TStatement | null', () => {
describe('variant #1: block statement node as scope node', () => {
let statementNode1: ESTree.Statement,
statementNode2: ESTree.Statement,