aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/solid-dom-fixtures/conditionalExpressions/code.js
blob: 80f1a6a4f3bb59a75ac88c925cf00c464c385538 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
const template1 = <div>{simple}</div>;

const template2 = <div>{state.dynamic}</div>;

const template3 = <div>{simple ? good : bad}</div>;

const template4 = <div>{simple ? good() : bad}</div>;

const template5 = <div>{state.dynamic ? good() : bad}</div>;

const template6 = <div>{state.dynamic && good()}</div>;

const template7 = (
  <div>{state.count > 5 ? (state.dynamic ? best : good()) : bad}</div>
);

const template8 = <div>{state.dynamic && state.something && good()}</div>;

const template9 = <div>{(state.dynamic && good()) || bad}</div>;

const template10 = (
  <div>{state.a ? "a" : state.b ? "b" : state.c ? "c" : "fallback"}</div>
);

const template11 = (
  <div>{state.a ? a() : state.b ? b() : state.c ? "c" : "fallback"}</div>
);

const template12 = <Comp render={state.dynamic ? good() : bad} />;

// no dynamic predicate
const template13 = <Comp render={state.dynamic ? good : bad} />;

const template14 = <Comp render={state.dynamic && good()} />;

// no dynamic predicate
const template15 = <Comp render={state.dynamic && good} />;

const template16 = <Comp render={state.dynamic || good()} />;

const template17 = <Comp render={state.dynamic ? <Comp /> : <Comp />} />;

const template18 = <Comp>{state.dynamic ? <Comp /> : <Comp />}</Comp>;

const template19 = <div innerHTML={state.dynamic ? <Comp /> : <Comp />} />;

const template20 = <div>{state.dynamic ? <Comp /> : <Comp />}</div>;

const template21 = <Comp render={state?.dynamic ? "a" : "b"} />;

const template22 = <Comp>{state?.dynamic ? "a" : "b"}</Comp>;

const template23 = <div innerHTML={state?.dynamic ? "a" : "b"} />;

const template24 = <div>{state?.dynamic ? "a" : "b"}</div>;

const template25 = <Comp render={state.dynamic ?? <Comp />} />;

const template26 = <Comp>{state.dynamic ?? <Comp />}</Comp>;

const template27 = <div innerHTML={state.dynamic ?? <Comp />} />;

const template28 = <div>{state.dynamic ?? <Comp />}</div>;

const template29 = <div>{(thing() && thing1()) ?? thing2() ?? thing3()}</div>;

const template30 = <div>{thing() || thing1() || thing2()}</div>;

const template31 = (
  <Comp value={count() ? (count() ? count() : count()) : count()} />
);