|
| 1 | +// chained members |
| 2 | +typeof foo !== 'undefined' && foo.bar; |
| 3 | +typeof foo.bar !== 'undefined' && foo.bar.baz; |
| 4 | +typeof foo !== 'undefined' && foo(); |
| 5 | +typeof foo.bar !== 'undefined' && foo.bar(); |
| 6 | +typeof foo !== 'undefined' && typeof foo.bar !== 'undefined' && typeof foo.bar.baz !== 'undefined' && foo.bar.baz.buzz; |
| 7 | +typeof foo.bar !== 'undefined' && typeof foo.bar.baz !== 'undefined' && foo.bar.baz.buzz; |
| 8 | + |
| 9 | +// case with a jump (i.e. a non-'undefined'ish prop) |
| 10 | +typeof foo !== 'undefined' && typeof foo.bar !== 'undefined' && foo.bar.baz.buzz; |
| 11 | +typeof foo.bar !== 'undefined' && foo.bar.baz.buzz; |
| 12 | + |
| 13 | +// case where for some reason there is a doubled up expression |
| 14 | +typeof foo !== 'undefined' && typeof foo.bar !== 'undefined' && typeof foo.bar.baz !== 'undefined' && typeof foo.bar.baz !== 'undefined' && foo.bar.baz.buzz; |
| 15 | +typeof foo.bar !== 'undefined' && typeof foo.bar.baz !== 'undefined' && typeof foo.bar.baz !== 'undefined' && foo.bar.baz.buzz; |
| 16 | + |
| 17 | +// chained members with element access |
| 18 | +typeof foo !== 'undefined' && typeof foo[bar] !== 'undefined' && typeof foo[bar].baz !== 'undefined' && foo[bar].baz.buzz; |
| 19 | + |
| 20 | +// case with a jump (i.e. a non-'undefined'ish prop) |
| 21 | +typeof foo !== 'undefined' && typeof foo[bar].baz !== 'undefined' && foo[bar].baz.buzz; |
| 22 | + |
| 23 | +// chained calls |
| 24 | +typeof foo !== 'undefined' && typeof foo.bar !== 'undefined' && typeof foo.bar.baz !== 'undefined' && foo.bar.baz.buzz(); |
| 25 | +typeof foo !== 'undefined' && typeof foo.bar !== 'undefined' && typeof foo.bar.baz !== 'undefined' && typeof foo.bar.baz.buzz !== 'undefined' && foo.bar.baz.buzz(); |
| 26 | +typeof foo.bar !== 'undefined' && typeof foo.bar.baz !== 'undefined' && typeof foo.bar.baz.buzz !== 'undefined' && foo.bar.baz.buzz(); |
| 27 | + |
| 28 | +// case with a jump (i.e. a non-'undefined'ish prop) |
| 29 | +typeof foo !== 'undefined' && typeof foo.bar !== 'undefined' && foo.bar.baz.buzz(); |
| 30 | +typeof foo.bar !== 'undefined' && foo.bar.baz.buzz(); |
| 31 | + |
| 32 | +// case with a jump (i.e. a non-'undefined'ish prop) |
| 33 | +typeof foo !== 'undefined' && typeof foo.bar !== 'undefined' && typeof foo.bar.baz.buzz !== 'undefined' && foo.bar.baz.buzz(); |
| 34 | + |
| 35 | +// case with a call expr inside the chain for some inefficient reason |
| 36 | +typeof foo !== 'undefined' && typeof foo.bar() !== 'undefined' && typeof foo.bar().baz !== 'undefined' && typeof foo.bar().baz.buzz !== 'undefined' && foo.bar().baz.buzz(); |
| 37 | + |
| 38 | + |
| 39 | +// chained members (double quotes) |
| 40 | +typeof foo !== "undefined" && foo.bar; |
| 41 | +typeof foo.bar !== "undefined" && foo.bar.baz; |
| 42 | +typeof foo !== "undefined" && foo(); |
| 43 | +typeof foo.bar !== "undefined" && foo.bar(); |
| 44 | +typeof foo !== "undefined" && typeof foo.bar !== "undefined" && typeof foo.bar.baz !== "undefined" && foo.bar.baz.buzz; |
| 45 | +typeof foo.bar !== "undefined" && typeof foo.bar.baz !== "undefined" && foo.bar.baz.buzz; |
| 46 | + |
| 47 | +// chained members (backticks) |
| 48 | +typeof foo !== `undefined` && foo.bar; |
| 49 | +typeof foo.bar !== `undefined` && foo.bar.baz; |
| 50 | +typeof foo !== `undefined` && foo(); |
| 51 | +typeof foo.bar !== `undefined` && foo.bar(); |
| 52 | +typeof foo !== `undefined` && typeof foo.bar !== `undefined` && typeof foo.bar.baz !== `undefined` && foo.bar.baz.buzz; |
| 53 | +typeof foo.bar !== `undefined` && typeof foo.bar.baz !== `undefined` && foo.bar.baz.buzz; |
0 commit comments