Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API setfenv

Last wiki revision 2023-05-02

Modifies the environment associated with a function. f = setfenv(f, env)

  • f: or - A function to modify the environment of, or a numeric level of a function on the call stack starting from 1.
  • env: - The environment to be assigned to the function.
  • f: - The function whose environment was modified.
  • This function will raise an error if the function to be modified has an existing environment whose metatable has an field set.
  • If this function is called insecurely and the modified function is a Lua function, the modified function will be irrevocably tainted. This will result in all future calls to the function tainting execution.

Source

https://warcraft.wiki.gg/wiki/API_setfenv · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.