File tree 2 files changed +3
-6
lines changed
2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { Lexer } from '@/generators/lexer'
2
2
import { State } from '@/state'
3
+ import { isNativeVariable } from '@/helpers/variables'
3
4
4
5
const IGNORED_IDS = [ 'this' , '$' ]
5
6
@@ -46,11 +47,7 @@ export class Data {
46
47
if ( attr === 'each' ) {
47
48
const [ _ , variable ] = expr . split ( ' in ' )
48
49
49
- const isNativeVariable =
50
- typeof window [ variable ] === 'function' &&
51
- window [ variable ] . toString ( ) . indexOf ( '[native code]' ) === - 1
52
-
53
- if ( isNativeVariable ) return
50
+ if ( isNativeVariable ( variable ) ) return
54
51
if ( IGNORED_IDS . includes ( variable ) ) return
55
52
if ( variable in this . entity . state ) return
56
53
this . add ( variable , attr )
Original file line number Diff line number Diff line change 1
1
export const isNativeVariable = ( variable ) =>
2
2
typeof window [ variable ] === 'function' &&
3
- window [ variable ] . toString ( ) . indexOf ( '[native code]' ) = == - 1
3
+ window [ variable ] . toString ( ) . indexOf ( '[native code]' ) ! == - 1
You can’t perform that action at this time.
0 commit comments