Skip to content

ensure the wrap stack is unique for overrides and decorators #8

@AndreLouisIssa

Description

@AndreLouisIssa

on some lua versions (e.g. lua 5.2) if two functions have the same bytecode, they get assigned the same function object in lua, so the reverse lookup approach of modutil may fail.

to fix this each user-provided function can be (uselessly) wrapped in another function and tail-returned, but this useless wrapper will be the result of the override/decorator operation and used as the reverse lookup rather than the user-provided function.

wraps are immune to this issue since they necessarily get wrapped up in this way already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions