String.dump does nothing in Roblox, but documentation says otherwise

I’m referring to string.dump on the API reference of the string library: string

Currently, the page says that string.dump Returns a string containing a binary representation of the given function, so that a later load on this string returns a copy of the function (but with new upvalues)., but this isn’t true in Roblox. Instead, string.dump will return an empty function (such that attempting to loadstring() whatever it returns will be nil).

Read this thread for more info:

and this reply by zeuxcg on the same thread saying that this is by design:

The thread also says that string.dump should still work in studio, but my testing doesn’t show that. It still returns an empty function regardless.

2 Likes

Not to mention that bytecode loading is disabled as of 2012… So yeah this is a documentation bug that we should fix. Cc @UristMcSparks

4 Likes