HaxeFoundation / HaxeFoundation/haxe

&& false and || true not being optimized

Open
#8,278 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

The following code:

```haxe
class Main {

static function bar(v) {
if( v == null && false ) throw "assert";
if( v == null || true ) throw "OK";
}

static function main() {
bar("");
}

}
```

Outputs the following JS:

```js
Main.bar = function(v) {
if(v == null && false) {
throw new js__$Boot_HaxeError("assert");
}
if(v == null || true) {
throw new js__$Boot_HaxeError("OK");
}
};
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.