mirror of
https://github.com/hanzoai/babel.git
synced 2026-10-30 14:46:06 +00:00
* Working helper * Added pkg.json description * 1.0.0 * cleanup build scripts * refactor: convert to TS * add checkDuplicateNodes to parser tests * remove babel core injection * ignore check-duplicate-nodes and readme generator * add test cases * refactor: simplify duplicate nodes tracking Co-authored-by: Mateusz Burzyński <[email protected]>
65 lines
1.4 KiB
Plaintext
65 lines
1.4 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`checkDuplicateNodes should throw on duplicate AST nodes within different parent 1`] = `
|
|
"Do not reuse nodes. Use \`t.cloneNode\` (or \`t.clone\`/\`t.cloneDeep\` if using babel@6) to copy them.
|
|
{
|
|
\\"type\\": \\"Identifier\\",
|
|
\\"name\\": \\"ref\\"
|
|
}
|
|
Parent:
|
|
[
|
|
{
|
|
\\"type\\": \\"VariableDeclarator\\",
|
|
\\"id\\": {
|
|
\\"type\\": \\"Identifier\\",
|
|
\\"name\\": \\"ref\\"
|
|
},
|
|
\\"init\\": null
|
|
},
|
|
{
|
|
\\"type\\": \\"AssignmentExpression\\",
|
|
\\"operator\\": \\"=\\",
|
|
\\"left\\": {
|
|
\\"type\\": \\"Identifier\\",
|
|
\\"name\\": \\"ref\\"
|
|
},
|
|
\\"right\\": {
|
|
\\"type\\": \\"NullLiteral\\"
|
|
}
|
|
}
|
|
]"
|
|
`;
|
|
|
|
exports[`checkDuplicateNodes should throw on duplicate AST nodes within same parent 1`] = `
|
|
"Do not reuse nodes. Use \`t.cloneNode\` (or \`t.clone\`/\`t.cloneDeep\` if using babel@6) to copy them.
|
|
{
|
|
\\"type\\": \\"Identifier\\",
|
|
\\"name\\": \\"ref\\"
|
|
}
|
|
Parent:
|
|
[
|
|
{
|
|
\\"type\\": \\"VariableDeclarator\\",
|
|
\\"id\\": {
|
|
\\"type\\": \\"Identifier\\",
|
|
\\"name\\": \\"ref\\"
|
|
},
|
|
\\"init\\": {
|
|
\\"type\\": \\"Identifier\\",
|
|
\\"name\\": \\"ref\\"
|
|
}
|
|
},
|
|
{
|
|
\\"type\\": \\"VariableDeclarator\\",
|
|
\\"id\\": {
|
|
\\"type\\": \\"Identifier\\",
|
|
\\"name\\": \\"ref\\"
|
|
},
|
|
\\"init\\": {
|
|
\\"type\\": \\"Identifier\\",
|
|
\\"name\\": \\"ref\\"
|
|
}
|
|
}
|
|
]"
|
|
`;
|