Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
Fix debugging of tests in Studio (#145)
Browse files Browse the repository at this point in the history
* Fix debugging of tests in Studio

Copy 'script' directly to new env to make Studio debugger happy, as it does not look into __index, because of security reasons

* Make comment line shorter
  • Loading branch information
amatosov-rbx authored Oct 2, 2020
1 parent 470e3da commit 6b5a2ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/TestPlan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ function TestNode:expand()
for key, value in pairs(self.environment) do
callbackEnv[key] = value
end
-- Copy 'script' directly to new env to make Studio debugger happy.
-- Studio debugger does not look into __index, because of security reasons
callbackEnv.script = originalEnv.script
setfenv(self.callback, callbackEnv)

local success, result = xpcall(self.callback, function(message)
Expand Down

0 comments on commit 6b5a2ec

Please sign in to comment.