fix: set strict flags if RunService.IsStudio is true

This commit is contained in:
littensy 2026-06-20 21:07:50 -07:00
parent 573533058f
commit d09fb5536b
4 changed files with 10 additions and 10 deletions

View file

@ -50,12 +50,12 @@ export const flags: {
/**
* Enforces synchronous, non-yielding behavior in signals and effects.
* Also enables state validation in Charm Sync to catch sync errors early.
* Enabled if the optimization level is below 2, which is true in studio.
* Enabled by default in Roblox Studio.
*/
strict: boolean;
/**
* Enforces immutability of tables by deep-freezing table values. Enabled
* if the optimization level is below 2, which is true in studio.
* by default in Roblox Studio.
*/
frozen: boolean;
/**

View file

@ -68,22 +68,22 @@ local batchDepth = 0
-- Dependencies accessed during this time will link to the active subscriber.
local activeSub: ReactiveNode?
local function isO2(): boolean
return debug.info(1, "n") ~= "isO2"
local function isStudio(): boolean
return game ~= nil and game:GetService("RunService"):IsStudio()
end
local flags = {
--[[
Enforces synchronous, non-yielding behavior in signals and effects.
Also enables state validation in Charm Sync to catch sync errors early.
Enabled if the optimization level is below 2, which is true in studio.
Enabled by default in Roblox Studio.
]]
strict = not isO2(),
strict = isStudio(),
--[[
Enforces immutability of tables by deep-freezing table values. Enabled
if the optimization level is below 2, which is true in studio.
by default in Roblox Studio.
]]
frozen = not isO2(),
frozen = isStudio(),
--[[
Whether parent effects should track inner effects and clean them up
when the parent effect re-runs. This is usually desirable, but can be