Skip to content

Commit 3783866

Browse files
authored
fix(compiler-core): typeof should be allowed in browser expression validation (#7037)
1 parent 11bd8db commit 3783866

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/compiler-core/src/validateExpression.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
// these keywords should not appear inside expressions, but operators like
2-
31
import { SimpleExpressionNode } from './ast'
42
import { TransformContext } from './transform'
53
import { createCompilerError, ErrorCodes } from './errors'
64

7-
// typeof, instanceof and in are allowed
5+
// these keywords should not appear inside expressions, but operators like
6+
// 'typeof', 'instanceof', and 'in' are allowed
87
const prohibitedKeywordRE = new RegExp(
98
'\\b' +
109
(
11-
'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
12-
'super,throw,while,yield,delete,export,import,return,switch,default,' +
13-
'extends,finally,continue,debugger,function,arguments,typeof,void'
10+
'arguments,await,break,case,catch,class,const,continue,debugger,default,' +
11+
'delete,do,else,export,extends,finally,for,function,if,import,let,new,' +
12+
'return,super,switch,throw,try,var,void,while,with,yield'
1413
)
1514
.split(',')
1615
.join('\\b|\\b') +

0 commit comments

Comments
 (0)