File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,16 @@ class Expression extends ExpressionSync {
2626 return Expression . FAIL ;
2727 }
2828
29- const val = ( ) => typeof right === 'function' ? right ( ) : right ;
29+ const s = v => {
30+ if ( typeof v === 'symbol' ) {
31+ this . state . fail = true ;
32+ return ;
33+ }
34+
35+ return v ;
36+ } ;
37+
38+ const val = ( ) => s ( typeof right === 'function' ? right ( ) : right ) ;
3039
3140 switch ( operator ) {
3241 case 'in' : {
Original file line number Diff line number Diff line change @@ -121,8 +121,17 @@ class ExpressionSync {
121121 return ExpressionSync . FAIL ;
122122 }
123123
124+ const s = v => {
125+ if ( typeof v === 'symbol' ) {
126+ this . state . fail = true ;
127+ return ;
128+ }
129+
130+ return v ;
131+ } ;
132+
124133 // only lazily evaluate "right" when necessary
125- const val = ( ) => typeof right === 'function' ? right ( ) : right ;
134+ const val = ( ) => s ( typeof right === 'function' ? right ( ) : right ) ;
126135
127136 if ( operator === 'in' ) {
128137 const value = val ( ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " eval-estree-expression" ,
33 "description" : " Safely evaluate JavaScript (estree) expressions, sync and async." ,
4- "version" : " 2.0.2 " ,
4+ "version" : " 2.0.3 " ,
55 "license" : " MIT" ,
66 "homepage" : " https://github.com/jonschlinkert/eval-estree-expression" ,
77 "author" : " Jon Schlinkert (https://github.com/jonschlinkert)" ,
You can’t perform that action at this time.
0 commit comments