@@ -178,6 +178,13 @@ instance MonadMask JSM where
178178 JSM $ uninterruptibleMask $ \unmask -> unJSM (a $ q unmask)
179179 where q :: (ReaderT JSContextRef IO a -> ReaderT JSContextRef IO a) -> JSM a -> JSM a
180180 q unmask (JSM b) = syncAfter . JSM $ unmask b
181+#if MIN_VERSION_exceptions(0,9,0)
182+ generalBracket acquire release use =
183+ JSM $ generalBracket
184+ (unJSM acquire)
185+ (\resource exitCase -> unJSM $ release resource exitCase)
186+ (unJSM . syncAfter . use)
187+#endif
181188
182189#endif
183190