src/factories/$Compile.js
function $$safeEvalFn(str) {
    let keyStr = '';

    // Perform any parsing that needs to be performed on the scope value
    for (let key in this) {
        let val = this[ key ];
        if (!val && val !== 0 && val !== '') {
            continue;
        } else if (
            typeof val === 'symbol' ||
            typeof val === 'string'
        ) {
            val = `"${val}"`;
        } else if (typeof val === 'object') {
            val = JSON.stringify(val);
        }

        // I don't like having to use var here
        keyStr += `var ${key}=${val};`;
    }

    // Literal eval is executed in its own context here to reduce security issues
    /* eslint-disable */
    return eval([ keyStr, str ].join(''));

    /* eslint-enable */
}
function $$safeEvalFn(str) {
    let keyStr = '';

    // Perform any parsing that needs to be performed on the scope value
    for (let key in this) {
        let val = this[ key ];
        if (!val && val !== 0 && val !== '') {
            continue;
        } else if (
            typeof val === 'symbol' ||
            typeof val === 'string'
        ) {
            val = `"${val}"`;
        } else if (typeof val === 'object') {
            val = JSON.stringify(val);
        }

        // I don't like having to use var here
        keyStr += `var ${key}=${val};`;
    }

    // Literal eval is executed in its own context here to reduce security issues
    /* eslint-disable */
    return eval([ keyStr, str ].join(''));

    /* eslint-enable */
}
function $$safeEvalFn ( str ) { let keyStr = '' ; // Perform any parsing that needs to be performed on the scope value for ( let key in this ) { let val = this [ key ] ; if ( ! val && val !== 0 && val !== '' ) { continue ; } else if ( typeof val === 'symbol' || typeof val === 'string' ) { val = ` ${ val } ` ; } else if ( typeof val === 'object' ) { val = JSON . stringify ( val ) ; } // I don't like having to use var here keyStr += ` ${ key } ${ val } ` ; } // Literal eval is executed in its own context here to reduce security issues /* eslint-disable */ return eval ( [ keyStr , str ] . join ( '' ) ) ; /* eslint-enable */ }
A private function to evaluate the parsed template string in the context of `scope`
A private function to evaluate the parsed template string in the context of scope