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

Support for logical assignment operators (&&= and ||=) #2527

Merged
merged 4 commits into from
Sep 10, 2023

Conversation

ChristophKaser
Copy link

... as specified in https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-assignment-operators

I wanted to precompile my code for duktape (or rather low.js) using the google closure compiler, which seems to use those operators a lot.

Unfortunately, I had to copy/paste some code in src-input/duk_js_compiler.c from the assignments-label, because logical operators don't quite fit the pattern of the other assignment operators (e.g. they don't always evaluate the rhs).

I have added some basic tests and compared them to the behavior of nodejs.

@svaarala svaarala merged commit 61ce5ea into svaarala:master Sep 10, 2023
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants