File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ const pathTestRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\
29
29
const identRE = / [ ^ \w $ \. ] (?: [ A - Z a - z _ $ ] [ \w $ ] * ) / g
30
30
const booleanLiteralRE = / ^ (?: t r u e | f a l s e ) $ /
31
31
32
+ function noop ( ) { }
33
+
32
34
/**
33
35
* Save / Rewrite / Restore
34
36
*
@@ -140,10 +142,23 @@ function makeGetterFn (body) {
140
142
return new Function ( 'scope' , 'return ' + body + ';' )
141
143
/* eslint-enable no-new-func */
142
144
} catch ( e ) {
143
- process . env . NODE_ENV !== 'production' && warn (
144
- 'Invalid expression. ' +
145
- 'Generated function body: ' + body
146
- )
145
+ if ( process . env . NODE_ENV !== 'production' ) {
146
+ /* istanbul ignore if */
147
+ if ( e . toString ( ) . match ( / u n s a f e - e v a l / ) ) {
148
+ warn (
149
+ 'It seems you are using the default build of Vue.js in an environment ' +
150
+ 'with Content Security Policy that prohibits unsafe-eval. ' +
151
+ 'Use the CSP-compliant build instead: ' +
152
+ 'http://vuejs.org/guide/installation.html#CSP-compliant-build'
153
+ )
154
+ } else {
155
+ warn (
156
+ 'Invalid expression. ' +
157
+ 'Generated function body: ' + body
158
+ )
159
+ }
160
+ }
161
+ return noop
147
162
}
148
163
}
149
164
You can’t perform that action at this time.
0 commit comments