Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullish Coalescing Operator #382

Closed
jmattheis opened this issue Apr 15, 2022 · 0 comments
Closed

Nullish Coalescing Operator #382

jmattheis opened this issue Apr 15, 2022 · 0 comments

Comments

@jmattheis
Copy link

jmattheis commented Apr 15, 2022

Related to #350, it would be cool if goja would support the nullish coalescing operator.

const maybeUndefined = undefined;
const withDefault = maybeUndefined ?? 'myDefault';

Typescript transpiles this to the following:

const maybeUndefined = undefined;
const withDefault = maybeUndefined !== null && maybeUndefined !== void 0 ? maybeUndefined : 'myDefault';

Keep up the good work (:

@dop251 dop251 added this to the ES6 (and beyond) milestone Apr 22, 2022
@dop251 dop251 closed this as completed in 160b8c5 Apr 24, 2022
Gabri3l pushed a commit to mongodb-forks/goja that referenced this issue Sep 1, 2022
Gabri3l added a commit to mongodb-forks/goja that referenced this issue Mar 15, 2023
* Fixed panic in newArrayFromIter when the iterator is already closed. Fixes dop251#375
* Fixed panic when parsing invalid object property keys. Fixes dop251#376.
* Fixed accidental shadowing in the else branches of type assertion
* Fixed defineProperty("length") for arrays. Improved detection of non-standard array configurations. Upgraded tc39 tests.
* Return true values of struct fields or reflect slice elements, rather than pointers to them. Closes dop251#378.
* Upgraded dependencies. Closes dop251#380.
* Implemented exponentiation expressions. Closes dop251#381.
* Enabled tests that use ** operator. Some array fixes as a result.
* Implemented nullish coalescing operator (??). Closes dop251#382.
* Implemented `{Array,String,%TypedArray%}.prototype.at` (dop251#384)e7c2872c8)
* Fixed callee expressions in optional chains. Fixes dop251#385.
* Do not use fmt.Sprintf() for plain error strings. Fixes dop251#388.
* Implemented 'copy-on-change' mechanism for inner compound values. Fixes dop251#403.
* Fixed objectGoReflect equality. See dop251#403
* Don't clear interrupt until the stack is empty (dop251#405)
* test: skip Promise based tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants