Description
I'm currently trying to implement notevil 1.1.0 into Vue to create a Vue 2.6-csp build. However I'm running into the fact that with statements are used in Vue and notevil throws an error for these statements: https://github.com/mmckegg/notevil/blob/master/index.js#L368
In Vue I am able to find the following code which probably triggers this (https://github.com/vuejs/vue/blob/2.6/src/compiler/codegen/index.js#L49):
with(this){return ${code}}
And somewhere in the code following where that line is executed by:
return new Function(code)
Which I have tried to replace with:
const fn = notevil.Function(code);
return function() {
return fn.call(this);
};
Where I have tried to inject the this property to be used in the with(this)
expression.
The result is a Unexpected expression: 'WithStatement'
error in my console.
Is it possible to add the ability to parse with statements? Or does anyone have suggestions on how to work around the with(this) expressions?