Lua code - System test1 | env = newCleanEnv() |
2 | load([[ |
3 | x = 1 |
4 | env2 = newCleanEnv() |
5 | load("x=2", "", "t", env2)()
|
6 | assert(x == 1, x) |
7 | assert(env2.x == 2) |
8 | |
9 | -- now with nil env - must default to env (not outer sandbox) |
10 | load("x=3")()
|
11 | assert(x == 3, x) |
12 | ]], "", "t", env)() |
13 | assert(x == nil) |
14 | assert(env.x == 3, env.x) |
15 | 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: | 1697 / 266 |
| Referenced in: | [show references] |