How to use the expressionStatement function from babel-types

Find comprehensive JavaScript babel-types.expressionStatement code examples handpicked from public code repositorys.

26
27
28
29
30
31
32
33
34
35
  ? moduleExports
  : t.memberExpression(
      moduleExports,
      t.identifier(property)
    );
return t.expressionStatement(
  t.assignmentExpression(
    '=',
    left,
    node
fork icon18
star icon51
watch icon5

225
226
227
228
229
230
231
232
233
234
  }
}

// join fragments
let expr =
  t.expressionStatement(
    t.assignmentExpression(
      '=',
      t.identifier('pug_html'),
      fragment.reduce(function(acc, val) {
fork icon5
star icon43
watch icon10

+ 22 other calls in file

15
16
17
18
19
20
21
22
23
24

async repair() {
    const self = this;
    function createElement(parentStatement, data, documentQuery) {
        let condition = t.binaryExpression('==', documentQuery, t.nullLiteral());
        const statement = t.expressionStatement(t.callExpression(t.memberExpression(t.identifier("bikinirepair"), t.identifier("createElement"), false), [
            data.query,
            t.booleanLiteral(data.isId),
            t.booleanLiteral(data.isClass),
            t.booleanLiteral(data.isQuery)
fork icon8
star icon11
watch icon7

+ 3 other calls in file

16
17
18
19
20
21
22
23
24
25
const root = translate(node.program);
const program = Array.isArray(root) ? root : [root];
return t.file(
  t.program(
    program.map(
      node => (t.isStatement(node) ? node : t.expressionStatement(node))
    ),
    []
  ),
  node
fork icon1
star icon10
watch icon2

+ 9 other calls in file

143
144
145
146
147
148
149
150
151
152
return _.flatten(
  this.model.belongsTo().map(([assoc_name, props]) => {
    const source = t.identifier('model');
    const target = t.memberExpression(models, t.identifier(assoc_name));

    const belongs_to_statment = t.expressionStatement(
      t.callExpression(
        t.memberExpression(source, t.identifier('belongsTo')),
        [
          target,
fork icon1
star icon5
watch icon2

+ 19 other calls in file

69
70
71
72
73
74
75
76
77
78
  null,
  t.binaryExpression('<', c.INDEX, c.LENGTH),
  t.updateExpression('++', c.INDEX),
  t.blockStatement([
    t.expressionStatement(t.assignmentExpression('=', key, c.INDEX)),
    t.expressionStatement(t.assignmentExpression('=', c.KEY, c.INDEX)),
    t.expressionStatement(t.assignmentExpression('+=', output, ConcatStringList(compile(branch.body)))),
  ]),
),
t.returnStatement(output),
fork icon17
star icon0
watch icon5

+ 5 other calls in file

24
25
26
27
28
29
30
31
32
33
          '=',
          t.identifier('emptyContinuationAux'),
          t.identifier('emptyContinuation'),
        ),
      ),
      t.expressionStatement(t.callExpression(t.identifier('emptyContinuation'), [])),
    ]),
    t.blockStatement([t.throwStatement(t.identifier('e'))]),
  ),
],
fork icon2
star icon5
watch icon3

+ 15 other calls in file

113
114
115
116
117
118
119
120
121
}

rulesRegistration = node.body.map(function (line) {
  line = updateStyleSheet(line, stylesheetId, options);
  if (line.type === 'CallExpression') {
    line = t.expressionStatement(updateStyleSheet(line, stylesheetId, options));
  }
  return line;
});
fork icon0
star icon5
watch icon1

28
29
30
31
32
33
34
35
36
37
let node = path.node
let declaration = node.declaration
let type = declaration.type // 导出对象,是一个Object或是一个 变量标识
if (type === 'ObjectExpression' || type === 'Identifier') {
  // console.log('babel-plugin-zving:', moduleRefer, '引用组件', filePath)
  let callExpression = types.expressionStatement(
    types.callExpression(
      types.identifier('namespace'),
      [types.stringLiteral(moduleRefer.replace(/\.\w+$/, ''))]
    )
fork icon1
star icon0
watch icon2

39
40
41
42
43
44
45
46
47
48
    'react-redux-rn': '@tarojs/taro-redux-rn',
    '@tarojs/mobx': '@tarojs/mobx',
    '@tarojs/mobx-rn': '@tarojs/mobx-rn'
};
const additionalConstructorNode = astConvert_1.convertSourceStringToAstExpression(`Taro._$app = this`);
const superNode = t.expressionStatement(t.callExpression(
// @ts-ignore
t.super(), [
    t.identifier('props'),
    t.identifier('context')
fork icon0
star icon0
watch icon0

+ 6 other calls in file

Other functions in babel-types

Sorted by popularity

function icon

babel-types.identifier is the most popular function in babel-types (4076 examples)