Skip to content

Commit

Permalink
trying to get out from this rabbit hole...
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Apr 16, 2016
1 parent 8b248a7 commit fb9370a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/csp.tmpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6014,7 +6014,7 @@
args = args.slice(0,-1)
if (typeof src === 'string'){
//HACK: esprima doesn't like returns outside functions
src = parse('function a(){' + src + '}').body[0].body
src = parse('function a(){ ' + src + '}').body[0].body
}
var tree = prepareAst(src)
return getFunction(tree, args, context)
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//#if CSP
// note that the path must be relative to the dist/ folder
import safeEval from '../src/notevil' //eslint-disable-line no-unused-vars
// note that the path must be relative to the dist/ folder
import safeEval from '../src/notevil' //eslint-disable-line no-unused-vars
//#endif

//#if 0
Expand Down
2 changes: 1 addition & 1 deletion src/notevil/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function getGlobal (str) {
var ctx = (typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this)
return typeof str !== 'undefined' ? ctx[str] : ctx
}
}
2 changes: 1 addition & 1 deletion src/notevil/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function FunctionFactory(parentContext){
args = args.slice(0,-1)
if (typeof src === 'string'){
//HACK: esprima doesn't like returns outside functions
src = parse('function a(){' + src + '}').body[0].body
src = parse('function a(){ ' + src + '}').body[0].body
}
var tree = prepareAst(src)
return getFunction(tree, args, context)
Expand Down

0 comments on commit fb9370a

Please sign in to comment.