Lines Matching +defs:node +defs:body
52 body: normalize_directives(M.body.map(from_moz)),
70 var node = from_moz(M.body);
71 if (node instanceof AST_BlockStatement) {
72 fn.body = normalize_directives(node.body);
75 fn.body = [];
76 fn.value = node;
101 body: normalize_directives(from_moz(M.body).body),
125 body: normalize_directives(from_moz(M.body).body),
134 properties: M.body.body.map(from_moz),
143 properties: M.body.body.map(from_moz),
204 body: normalize_directives(M.body.map(from_moz)),
214 body: from_moz(M.body),
225 body : from_moz(M.block).body,
315 body : M.consequent.map(from_moz),
359 body: decl,
366 body: from_moz(M.declaration),
483 var negate, node;
487 node = new AST_Number(args);
490 node = new AST_Infinity(args);
496 expression: node,
497 }) : node;
531 if (p.body !== FROM_MOZ_STACK[level + 1]) ctor = AST_SymbolFunarg;
583 var node = from_moz(M.expression);
584 if (!node.start.parens) node.start.parens = [];
585 node.start.parens.push(my_start_token(M));
586 if (!node.end.parens) node.end.parens = [];
587 node.end.parens.push(my_end_token(M));
588 return node;
591 var node = from_moz(M.expression);
592 node.terminal = true;
593 return node;
610 map("ExpressionStatement", AST_SimpleStatement, "expression>body");
611 map("BlockStatement", AST_BlockStatement, "body@body");
612 map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative");
613 map("LabeledStatement", AST_LabeledStatement, "label>label, body>body");
616 map("WithStatement", AST_With, "object>expression, body>body");
617 map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body");
620 map("WhileStatement", AST_While, "test>condition, body>body");
621 map("DoWhileStatement", AST_Do, "test>condition, body>body");
622 map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body");
623 map("ForInStatement", AST_ForIn, "left>init, right>object, body>body");
626 map("CatchClause", AST_Catch, "param>argname, body%body");
657 body: to_moz_scope("BlockStatement", M),
671 body: M.value ? to_moz(M.value) : to_moz_scope("BlockStatement", M),
679 body: to_moz_scope("BlockStatement", M),
688 body: {
690 body: M.properties.map(to_moz),
700 body: {
702 body: M.properties.map(to_moz),
760 body: to_moz(M.body),
781 consequent: M.body.map(to_moz),
800 body: to_moz_block(M),
807 declaration: to_moz(M.body),
814 declaration: to_moz(M.body),
1111 function normalize_directives(body) {
1112 for (var i = 0; i < body.length; i++) {
1113 var stat = body[i];
1115 var node = stat.body;
1116 if (!(node instanceof AST_String)) break;
1117 if (stat.start.pos !== node.start.pos) break;
1118 body[i] = new AST_Directive(node);
1120 return body;
1190 moz_to_me.push(my + ": from_moz(M." + moz + ").body");
1218 var node = null;
1221 node = MOZ_TO_ME[moz.type](moz);
1224 return node;
1235 AST_Node.from_mozilla_ast = function(node) {
1238 var ast = from_moz(node);
1240 ast.walk(new TreeWalker(function(node) {
1241 if (node instanceof AST_LabelRef) {
1244 if (parent instanceof AST_LabeledStatement && parent.label.name == node.name) {
1245 node.thedef = parent.label;
1249 if (!node.thedef) {
1250 var s = node.start;
1251 js_error("Undefined label " + node.name, s.file, s.line, s.col, s.pos);
1282 function to_moz(node) {
1283 return node != null ? node.to_mozilla_ast() : null;
1293 function to_moz_block(node) {
1296 body: node.body.map(to_moz),
1300 function to_moz_scope(type, node) {
1301 var body = node.body.map(to_moz);
1302 if (node.body[0] instanceof AST_SimpleStatement && node.body[0].body instanceof AST_String) {
1303 body.unshift(to_moz(new AST_EmptyStatement(node.body[0])));
1307 body: body,