Executor functions in regular Luau

I made some functions that replicate functions in executors: (will get updated)

Feedback would be appreciated :pray:

1 Like

great topic!
coudl you make a github repo so i can make a PR? i would like to contribute

function compareinstances(a, b)
    local function f(x)
        if typeof(x) ~= "userdata" then
            return x
        end

        local mt = getmetatable(x)
        if type(mt) ~= "table" then
            -- no mt or __metatable is as tring
            return x
        end

        -- cloneref() puts the original thing in mt.__newindex
        local inner = rawget(mt, "__newindex")
        if inner == nil then
            return x
        end

        return inner
    end

    return rawequal(f(a), f(b))
end

edit: i have seliware docs as a .txt file; let me know if you’d like to take a look at it

1 Like

It used to be called “UNC-for-bad-executors” so bad executors could use the functions, that’s why it accesses some properties that are only accessible through an actual executor

I will improve it, do not worry

1 Like