dillon1000/react

Commit

[test] Test case for optional chaining in codegen

```js 

// here, `a?.b.c` is a single optional chain 

// (evaluates to undefined if a is nullish) 

a?.b.c; 

// here, 'a?.b` is an optional chain, and `.c` is an unconditional load 

// (nullthrows if a is nullish) 

(a?.b).c; 

``` 

--- 

Next PR in stack will add a bailout for `(a?.b).c`. 

(If we want to properly handle `(a?.b).c`, we might want to model optional 
chains explicitly in the HIR. We currently assume that any `PropertyLoad` whose 
lhs is an optional property load is read conditionally.)
Browse files
Changed paths2 files
First-parent comparison
A compiler/forget/src/__tests__/fixtures/compiler/_bug.optional-chaining-memberexpr.expect.md AddedA compiler/forget/src/__tests__/fixtures/compiler/_bug.optional-chaining-memberexpr.js Added
Patch

Files changed

Rendering syntax-highlighted changes…