Lines Matching refs:node
31 ClassDeclaration(node, state, c) {
33 state.prepend(node, `${node.id.name}=`);
36 `let ${node.id.name}; `,
40 walk.base.ClassDeclaration(node, state, c);
42 ForOfStatement(node, state, c) {
43 if (node.await === true) {
46 walk.base.ForOfStatement(node, state, c);
48 FunctionDeclaration(node, state, c) {
49 state.prepend(node, `this.${node.id.name} = ${node.id.name}; `);
52 `var ${node.id.name}; `,
58 AwaitExpression(node, state, c) {
60 walk.base.AwaitExpression(node, state, c);
62 ReturnStatement(node, state, c) {
64 walk.base.ReturnStatement(node, state, c);
66 VariableDeclaration(node, state, c) {
67 const variableKind = node.kind;
75 node.start,
76 node.start + variableKind.length + (isIterableForDeclaration ? 1 : 0),
79 'void' + (node.declarations.length === 1 ? '' : ' ('),
83 ArrayPrototypeForEach(node.declarations, (decl) => {
88 if (node.declarations.length !== 1) {
89 state.append(node.declarations[node.declarations.length - 1], ')');
97 function registerVariableDeclarationIdentifiers(node) {
98 switch (node.type) {
102 node.name,
106 ArrayPrototypeForEach(node.properties, (property) => {
111 ArrayPrototypeForEach(node.elements, (element) => {
118 ArrayPrototypeForEach(node.declarations, (decl) => {
135 walk.base.VariableDeclaration(node, state, c);
142 visitors[nodeType] = (node, state, c) => {
143 const isNew = node !== state.ancestors[state.ancestors.length - 1];
145 ArrayPrototypePush(state.ancestors, node);
147 callback(node, state, c);
205 prepend(node, str) {
206 wrappedArray[node.start] = str + wrappedArray[node.start];
208 append(node, str) {
209 wrappedArray[node.end - 1] += str;
225 const node = body.body[i];
226 if (node.type === 'EmptyStatement') continue;
227 if (node.type === 'ExpressionStatement') {
230 // ^^^^^^^^^^ // node
231 // ^^^^ // node.expression
234 // therefore we prepend the `return (` to `node`.
238 // node.expression.end and the semicolon, appending one more to
239 // node.expression should be fine.
247 state.prepend(node.expression, '{ value: (');
248 state.prepend(node, 'return ');
249 state.append(node.expression, ') }');