Skip to content

Do (And, Or, Not) reuse boolexpr in Jass? #186

@Luashine

Description

@Luashine

beginner friendly

/**
Always returns a new boolean expression that has the result of evaluating logical (NOT expr1).

@note Always returns a new boolexpr in Lua (v2.0.3.22988 and earlier) even when reusing previous `Condition`/`Filter`.
TODO: What about Jass VM? At least it reuses previously created `Condition`/`Filter`.

@note `boolexpr` extends from `agent` and must be explicitly destroyed with `DestroyBoolExpr` to prevent leaks.
However, most functions from blizzard.j destroy passed boolexpr automatically.
*/
native Not              takes boolexpr operand returns boolexpr

In Lua these functions don't reuse the previously existing filter/condition/and/or/not expressions and always create a new object. Please test this in Jass again, by supplying the same function twice and comparing them or their handle IDs.

  1. Test: And, Or, Not
  2. Share results here
  3. Update jassdoc

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions