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
ID | Author/Program | Comment | Date | |
---|---|---|---|---|
644 | #1000610 | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { 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 }} | 2015-08-19 02:32:06 | delete |
642 | #1000604 (pitcher) | 2015-08-18 00:07:22 |
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: | 1235 / 195 |
Referenced in: | [show references] |