         beginCatch: (result) -> ir.createCall @ejs_runtime.begin_catch, [(ir.createPointerCast result, types.int8Pointer, "")], "catchval"
         endCatch:            -> ir.createCall @ejs_runtime.end_catch, [], "endcatch"
 
-        doInsideBlock: (b, f) ->
+        doInsideExitableScope: (scope, f) ->
+                scope.enter()
+                f()
+                scope.leave()
+                
+        doInsideBBlock: (b, f) ->
                 saved = ir.getInsertBlock()
                 ir.setInsertPoint b
                 f()

                                        switch_stmt.addCase (consts.int32 ExitableScope.REASON_RETURN), return_tramp

                                falloff_tramp = new llvm.BasicBlock "falloff_tramp", insertFunc
                                @doInsideBlock falloff_tramp, =>
                                        ir.createBr merge_block
                                switch_stmt.addCase (consts.int32 TryExitableScope.REASON_FALLOFF_TRY), falloff_tramp

                                for s in [0...scope.destinations.length]
                                        dest_tramp = new llvm.BasicBlock "dest_tramp", insertFunc
                                        dest = scope.destinations[s]
                                        @doInsideBlock dest_tramp, =>
                                                if dest.reason == TryExitableScope.REASON_BREAK
                                                        dest.scope.exitAft true
                                                else if dest.reason == TryExitableScope.REASON_CONTINUE

                        undef = (consts.int64_lowhi 0xfff90000, 0x00000000)
                else
                        undef = @createLoad @ejs_runtime.undefined, "load_undefined"
                        undef.constant_val = undefined
                undef

