env = newCleanEnv() load([[ x = 1 env2 = newCleanEnv() load("x=2", "", "t", env2)() assert(x == 1, x) assert(env2.x == 2) -- now with nil env - must default to env (not outer sandbox) load("x=3")() assert(x == 3, x) ]], "", "t", env)() assert(x == nil) assert(env.x == 3, env.x) return true
Began life as a copy of #173
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
2 comment(s) hidden. show
Recognizer | Recognition Result | Visualize | Recalc |
---|---|---|---|
#308 | 323 | [visualize] |
Snippet ID: | #174 |
Snippet name: | Nested sandboxes (test case) |
Eternal ID of this version: | #174/1 |
Text MD5: | 99d331e7f8b502dd3f08305f525b42ca |
Author: | stefan |
Category: | system tests |
Type: | Lua code - System test |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2014-01-15 23:36:12 |
Source code size: | 323 bytes / 15 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 1257 / 199 |
Referenced in: | [show references] |