If I start with this code
import { assert } from '@ember/debug';
const foo = { bar: { baz: 'something' } };
assert('baz', foo.bar?.baz);
it gets transformed into
const foo = {
bar: {
baz: 'something'
}
};
(true && !(_foo$bar.baz) && Ember.assert('baz', (_foo$bar = foo.bar) === null || _foo$bar === void 0 ? void 0 : _foo$bar.baz));
The first check for !(_foo$bar.baz) is performed before the (_foo$bar = foo.bar) assignment, which means it will always throw an error, regardless of the actual value.