|
1 |
| -// these keywords should not appear inside expressions, but operators like |
2 |
| - |
3 | 1 | import { SimpleExpressionNode } from './ast'
|
4 | 2 | import { TransformContext } from './transform'
|
5 | 3 | import { createCompilerError, ErrorCodes } from './errors'
|
6 | 4 |
|
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 |
8 | 7 | const prohibitedKeywordRE = new RegExp(
|
9 | 8 | '\\b' +
|
10 | 9 | (
|
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' |
14 | 13 | )
|
15 | 14 | .split(',')
|
16 | 15 | .join('\\b|\\b') +
|
|
0 commit comments