@@ -213,29 +213,34 @@ export default function transformStylexProps(
213213 if ( nonNullProps === true ) {
214214 styleNonNullProps = true ;
215215 } else {
216- const { confident, value : styleValue } = evaluate (
217- path ,
218- state ,
219- evaluatePathFnConfig ,
220- ) ;
221- if (
222- ! confident ||
223- styleValue == null ||
224- styleValue . __IS_PROXY === true
225- ) {
216+ try {
217+ const { confident, value : styleValue } = evaluate (
218+ path ,
219+ state ,
220+ evaluatePathFnConfig ,
221+ ) ;
222+ if (
223+ ! confident ||
224+ styleValue == null ||
225+ styleValue . __IS_PROXY === true
226+ ) {
227+ nonNullProps = true ;
228+ styleNonNullProps = true ;
229+ } else {
230+ styleNonNullProps =
231+ nonNullProps === true ? true : [ ...nonNullProps ] ;
232+ if ( nonNullProps !== true ) {
233+ nonNullProps = [
234+ ...nonNullProps ,
235+ ...Object . keys ( styleValue ) . filter (
236+ ( key ) => styleValue [ key ] !== null ,
237+ ) ,
238+ ] ;
239+ }
240+ }
241+ } catch {
226242 nonNullProps = true ;
227243 styleNonNullProps = true ;
228- } else {
229- styleNonNullProps =
230- nonNullProps === true ? true : [ ...nonNullProps ] ;
231- if ( nonNullProps !== true ) {
232- nonNullProps = [
233- ...nonNullProps ,
234- ...Object . keys ( styleValue ) . filter (
235- ( key ) => styleValue [ key ] !== null ,
236- ) ,
237- ] ;
238- }
239244 }
240245 }
241246
@@ -356,16 +361,20 @@ function parseNullableStyle(
356361 }
357362 }
358363
359- const parsedObj = evaluate ( path , state , evaluatePathFnConfig ) ;
360- if (
361- parsedObj . confident &&
362- parsedObj . value != null &&
363- typeof parsedObj . value === 'object'
364- ) {
365- if ( parsedObj . value . __IS_PROXY === true ) {
366- return 'other' ;
364+ try {
365+ const parsedObj = evaluate ( path , state , evaluatePathFnConfig ) ;
366+ if (
367+ parsedObj . confident &&
368+ parsedObj . value != null &&
369+ typeof parsedObj . value === 'object'
370+ ) {
371+ if ( parsedObj . value . __IS_PROXY === true ) {
372+ return 'other' ;
373+ }
374+ return parsedObj . value ;
367375 }
368- return parsedObj . value ;
376+ } catch {
377+ return 'other' ;
369378 }
370379
371380 return 'other' ;
0 commit comments