getscriptthread
当 Real 可以找到时,返回与 script object 关联的 Lua thread。argument 必须是 object。该 function 会读取该值的 ClassName field,如果该 field 不是 string,会抛出 “not a valid Instance”。接受的 ClassName 值是 Script、LocalScript 和 ModuleScript;任何其他值都会抛出 “Script expected”。它首先通过 script reference 检查 Real 的 ScriptThreadCache。cache hit 时,返回缓存的 Luau thread 作为 thread。cache miss 时,Script 值必须具有 RunContext Client,否则 function 会抛出 “Expected a Script with RunContext set to Client”。然后它遍历 the live Luau thread list,沿着每个 thread node 的 first weak thread reference 到 LiveLuaRef,跳过 missing thread data 或 expired Script stored references,并将每个 script reference 与请求的 script 比较。如果找到 match,则返回该 Luau thread 作为 thread。如果没有找到 match,则返回 nil。