rusty-ecma / RESSA

Rusty EcmaScript Syntax Analyzer
MIT License
111 stars 14 forks source link

Optional chaining not supported #65

Open azw413 opened 3 years ago

azw413 commented 3 years ago

Apologies for keeping you busy ! These are very new so I fully understand if you don't support them :-

let vehicle = {
};

let vehicle1 = {
    car: {
        name: 'ABC',
        speed: 90
    }
};

console.log(vehicle.car?.name); // Undefined
console.log(vehicle.car?.speed); // Undefined

console.log(vehicle1.car?.name); // ABC
console.log(vehicle1.car?.speed); // 90

yields the following error :- UnexpectedToken(Position { line: 12, column: 25 }, "Expected{,[, or(; found Punct(Period)")

FreeMasen commented 3 years ago

The general goal is to support features that have made it to stage 3 in the proposal process. In a quick glance across the proposal stages, I wasn't able to find the ? operator, do you know where the proposal is currently?

There is an issue on this repo about currently unimplemented stage 3 features that I try an keep up to date

azw413 commented 1 year ago

It looks like these are Stage 4 now :- https://github.com/TC39/proposal-optional-chaining https://github.com/tc39/proposal-nullish-coalescing This article describes all the 'new' things in es2020: https://www.w3schools.com/js/js_2020.asp