浏览代码

fix component swap test

Evan Almloff 1 年之前
父节点
当前提交
50873bf9c7
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      packages/core/src/runtime.rs

+ 6 - 2
packages/core/src/runtime.rs

@@ -94,9 +94,13 @@ impl Runtime {
     ///
     ///
     /// Useful in a limited number of scenarios
     /// Useful in a limited number of scenarios
     pub fn on_scope<O>(&self, id: ScopeId, f: impl FnOnce() -> O) -> O {
     pub fn on_scope<O>(&self, id: ScopeId, f: impl FnOnce() -> O) -> O {
-        self.scope_stack.borrow_mut().push(id);
+        {
+            self.scope_stack.borrow_mut().push(id);
+        }
         let o = f();
         let o = f();
-        self.scope_stack.borrow_mut().pop();
+        {
+            self.scope_stack.borrow_mut().pop();
+        }
         o
         o
     }
     }