diff options
-rw-r--r-- | 010vm.cc | 4 | ||||
-rw-r--r-- | 101run_sandboxed.cc | 12 |
2 files changed, 5 insertions, 11 deletions
diff --git a/010vm.cc b/010vm.cc index 4c8298d4..21f81d20 100644 --- a/010vm.cc +++ b/010vm.cc @@ -243,6 +243,10 @@ void save_snapshots() { void restore_snapshots() { Recipe = Recipe_snapshot; Recipe_ordinal = Recipe_ordinal_snapshot; + restore_non_recipe_snapshots(); +} +// when running sandboxes in the edit/ app we'll want to restore everything except recipes defined in the app +void restore_non_recipe_snapshots() { Type_ordinal = Type_ordinal_snapshot; Type = Type_snapshot; // End restore_snapshots diff --git a/101run_sandboxed.cc b/101run_sandboxed.cc index 46331b49..f15e4d2a 100644 --- a/101run_sandboxed.cc +++ b/101run_sandboxed.cc @@ -472,17 +472,7 @@ case RELOAD: { } :(before "End Primitive Recipe Implementations") case RELOAD: { - // conundrum: need to support repeated reloads of the same code, but not - // wipe out state for the current test - // hacky solution: subset of restore_snapshots() without restoring recipes { - // can't yet define containers in a test that runs 'reload' - Type_ordinal = Type_ordinal_snapshot; - Type = Type_snapshot; - // can't yet create new specializations of shape-shifting recipes in a test - // that runs 'reload' - Recipe_variants = Recipe_variants_snapshot; - Name = Name_snapshot; - // } + restore_non_recipe_snapshots(); string code = read_mu_text(ingredients.at(0).at(0)); run_code_begin(/*should_stash_snapshots*/false); routine* save_current_routine = Current_routine; |