# All files / gogocode-core/src/js-core build-map.js

77.78% Statements 7/9
100% Branches 0/0
71.43% Functions 5/7
77.78% Lines 7/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    3237x
    37x

    15x

    2x

    24x

    2x

    2x

     const parse = require('./parse');
    module.exports = {
        ObjectExpression(str) {
            return parse(`var o = ${str}`).program.body[0].declarations[0].init;
        },
        DestructuringParam(str) {
            return parse(`(${str}) => {}`).program.body[0].expression.params[0];
        },
        ObjectProperty(str) {
            return parse(`({${str}})`).program.body[0].expression.properties[0]
        },
        ObjectMethod(str) {
            return parse(`({${str}})`).program.body[0].expression.properties[0]
        },
        Decorators(str) {
            return parse(
                `${str}
                class A {}`)
                .program.body[0].decorators;
        },
        ClassMethod(str) {
            return parse(`class a$ {
                ${str}
            }`).program.body[0].body.body[0]
        },
        ClassProperty(str) {
            return parse(`class a$ {
                ${str}
            }`).program.body[0].body.body[0]
        }
    }