1
1
import { makeCompile } from './_utils'
2
2
import {
3
+ IRDynamicPropsKind ,
3
4
IRNodeTypes ,
4
5
transformChildren ,
5
6
transformElement ,
@@ -257,7 +258,12 @@ describe('compiler: element transform', () => {
257
258
{
258
259
type : IRNodeTypes . CREATE_COMPONENT_NODE ,
259
260
tag : 'Foo' ,
260
- props : [ { value : { content : 'obj' , isStatic : false } } ] ,
261
+ props : [
262
+ {
263
+ kind : IRDynamicPropsKind . EXPRESSION ,
264
+ value : { content : 'obj' , isStatic : false } ,
265
+ } ,
266
+ ] ,
261
267
} ,
262
268
] )
263
269
} )
@@ -277,7 +283,10 @@ describe('compiler: element transform', () => {
277
283
tag : 'Foo' ,
278
284
props : [
279
285
[ { key : { content : 'id' } , values : [ { content : 'foo' } ] } ] ,
280
- { value : { content : 'obj' } } ,
286
+ {
287
+ kind : IRDynamicPropsKind . EXPRESSION ,
288
+ value : { content : 'obj' } ,
289
+ } ,
281
290
] ,
282
291
} ,
283
292
] )
@@ -297,7 +306,10 @@ describe('compiler: element transform', () => {
297
306
type : IRNodeTypes . CREATE_COMPONENT_NODE ,
298
307
tag : 'Foo' ,
299
308
props : [
300
- { value : { content : 'obj' } } ,
309
+ {
310
+ kind : IRDynamicPropsKind . EXPRESSION ,
311
+ value : { content : 'obj' } ,
312
+ } ,
301
313
[ { key : { content : 'id' } , values : [ { content : 'foo' } ] } ] ,
302
314
] ,
303
315
} ,
@@ -320,7 +332,10 @@ describe('compiler: element transform', () => {
320
332
tag : 'Foo' ,
321
333
props : [
322
334
[ { key : { content : 'id' } , values : [ { content : 'foo' } ] } ] ,
323
- { value : { content : 'obj' } } ,
335
+ {
336
+ kind : IRDynamicPropsKind . EXPRESSION ,
337
+ value : { content : 'obj' } ,
338
+ } ,
324
339
[ { key : { content : 'class' } , values : [ { content : 'bar' } ] } ] ,
325
340
] ,
326
341
} ,
@@ -373,7 +388,13 @@ describe('compiler: element transform', () => {
373
388
{
374
389
type : IRNodeTypes . CREATE_COMPONENT_NODE ,
375
390
tag : 'Foo' ,
376
- props : [ { value : { content : 'obj' } , handler : true } ] ,
391
+ props : [
392
+ {
393
+ kind : IRDynamicPropsKind . EXPRESSION ,
394
+ value : { content : 'obj' } ,
395
+ handler : true ,
396
+ } ,
397
+ ] ,
377
398
} ,
378
399
] )
379
400
} )
@@ -444,6 +465,7 @@ describe('compiler: element transform', () => {
444
465
element : 0 ,
445
466
props : [
446
467
{
468
+ kind : IRDynamicPropsKind . EXPRESSION ,
447
469
value : {
448
470
type : NodeTypes . SIMPLE_EXPRESSION ,
449
471
content : 'obj' ,
@@ -479,6 +501,7 @@ describe('compiler: element transform', () => {
479
501
props : [
480
502
[ { key : { content : 'id' } , values : [ { content : 'foo' } ] } ] ,
481
503
{
504
+ kind : IRDynamicPropsKind . EXPRESSION ,
482
505
value : {
483
506
type : NodeTypes . SIMPLE_EXPRESSION ,
484
507
content : 'obj' ,
@@ -506,7 +529,10 @@ describe('compiler: element transform', () => {
506
529
type : IRNodeTypes . SET_DYNAMIC_PROPS ,
507
530
element : 0 ,
508
531
props : [
509
- { value : { content : 'obj' } } ,
532
+ {
533
+ kind : IRDynamicPropsKind . EXPRESSION ,
534
+ value : { content : 'obj' } ,
535
+ } ,
510
536
[ { key : { content : 'id' } , values : [ { content : 'foo' } ] } ] ,
511
537
] ,
512
538
} ,
@@ -530,7 +556,10 @@ describe('compiler: element transform', () => {
530
556
element : 0 ,
531
557
props : [
532
558
[ { key : { content : 'id' } , values : [ { content : 'foo' } ] } ] ,
533
- { value : { content : 'obj' } } ,
559
+ {
560
+ kind : IRDynamicPropsKind . EXPRESSION ,
561
+ value : { content : 'obj' } ,
562
+ } ,
534
563
[ { key : { content : 'class' } , values : [ { content : 'bar' } ] } ] ,
535
564
] ,
536
565
} ,
@@ -714,10 +743,12 @@ describe('compiler: element transform', () => {
714
743
tag : 'Foo' ,
715
744
props : [
716
745
{
746
+ kind : IRDynamicPropsKind . ATTRIBUTE ,
717
747
key : { content : 'foo-bar' } ,
718
748
values : [ { content : 'bar' } ] ,
719
749
} ,
720
750
{
751
+ kind : IRDynamicPropsKind . ATTRIBUTE ,
721
752
key : { content : 'baz' } ,
722
753
values : [ { content : 'qux' } ] ,
723
754
} ,
@@ -737,11 +768,13 @@ describe('compiler: element transform', () => {
737
768
tag : 'Foo' ,
738
769
props : [
739
770
{
771
+ kind : IRDynamicPropsKind . ATTRIBUTE ,
740
772
key : { content : 'foo-bar' } ,
741
773
values : [ { content : 'bar' } ] ,
742
774
handler : true ,
743
775
} ,
744
776
{
777
+ kind : IRDynamicPropsKind . ATTRIBUTE ,
745
778
key : { content : 'baz' } ,
746
779
values : [ { content : 'qux' } ] ,
747
780
handler : true ,
0 commit comments