-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Can't use compiler in strict mode #8145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The compiler works fine in strict mode. Or maybe you mean you have a strict CSP? Either way, you need to provide more information or a reproduction because the in-browser compilation works regardless of strict mode or not. The below works: 'use strict'
const f = new Function('with (this) { console.log("foo") }')
f() // works |
@yyx990803 I posted this issue before seeing #3832. That gave me much more clarity, and I did the hack that was suggested there which caused my code to work. However I did not try the new Function syntax, does that make strict mode work? |
I’m also working in salesforce on the same problem as described above in the other issue. I am using run-time compilation. I was getting the error because of the with keyword. If I add |
@yyx990803 I changed the main Vue code to this:
Salesforce still threw an error saying "Strict mode code may not include a with statement" |
Uh oh!
There was an error while loading. Please reload this page.
What problem does this feature solve?
We cannot use the compiler in strict mode because it uses the
with
statement.https://github.com/vuejs/vue/blob/master/src/compiler/codegen/index.js#L47
I have to compile templates in the browser at run time in strict mode. Anybody have a solution for this?
What does the proposed API look like?
Change all
with
statements to another solution.The text was updated successfully, but these errors were encountered: