@@ -506,7 +506,8 @@ describe('compiler: expression transform', () => {
506
506
data : BindingTypes . DATA ,
507
507
options : BindingTypes . OPTIONS ,
508
508
reactive : BindingTypes . SETUP_REACTIVE_CONST ,
509
- literal : BindingTypes . LITERAL_CONST
509
+ literal : BindingTypes . LITERAL_CONST ,
510
+ isNaN : BindingTypes . SETUP_REF
510
511
}
511
512
512
513
function compileWithBindingMetadata (
@@ -522,10 +523,11 @@ describe('compiler: expression transform', () => {
522
523
523
524
test ( 'non-inline mode' , ( ) => {
524
525
const { code } = compileWithBindingMetadata (
525
- `<div>{{ props }} {{ setup }} {{ data }} {{ options }}</div>`
526
+ `<div>{{ props }} {{ setup }} {{ data }} {{ options }} {{ isNaN }} </div>`
526
527
)
527
528
expect ( code ) . toMatch ( `$props.props` )
528
529
expect ( code ) . toMatch ( `$setup.setup` )
530
+ expect ( code ) . toMatch ( `$setup.isNaN` )
529
531
expect ( code ) . toMatch ( `$data.data` )
530
532
expect ( code ) . toMatch ( `$options.options` )
531
533
expect ( code ) . toMatch ( `_ctx, _cache, $props, $setup, $data, $options` )
@@ -534,14 +536,15 @@ describe('compiler: expression transform', () => {
534
536
535
537
test ( 'inline mode' , ( ) => {
536
538
const { code } = compileWithBindingMetadata (
537
- `<div>{{ props }} {{ setup }} {{ setupConst }} {{ data }} {{ options }}</div>` ,
539
+ `<div>{{ props }} {{ setup }} {{ setupConst }} {{ data }} {{ options }} {{ isNaN }} </div>` ,
538
540
{ inline : true }
539
541
)
540
542
expect ( code ) . toMatch ( `__props.props` )
541
543
expect ( code ) . toMatch ( `_unref(setup)` )
542
544
expect ( code ) . toMatch ( `_toDisplayString(setupConst)` )
543
545
expect ( code ) . toMatch ( `_ctx.data` )
544
546
expect ( code ) . toMatch ( `_ctx.options` )
547
+ expect ( code ) . toMatch ( `isNaN.value` )
545
548
expect ( code ) . toMatchSnapshot ( )
546
549
} )
547
550
0 commit comments