- (js!selfcall
- "try {"
- "var " idvar " = [];"
- `(code ,cbody)
- "}"
- "catch (cf){"
- " if (cf.type == 'block' && cf.id == " idvar ")"
- (if *multiple-value-p*
- " return values.apply(this, forcemv(cf.values));"
- " return cf.values;")
-
- " else"
- " throw cf;"
- "}" )
- (js!selfcall cbody)))))
+ `(selfcall
+ (try
+ (var (,(make-symbol idvar) #()))
+ ,cbody)
+ (catch (cf)
+ (if (and (== (get cf "type") "block")
+ (== (get cf "id") ,(make-symbol idvar)))
+ ,(if *multiple-value-p*
+ `(return (call (get |values| "apply") this (call |forcemv| (get cf "values"))))
+ `(return (get cf "values")))
+ (throw cf))))
+ ;; TODO: is selfcall necessary here?
+ `(selfcall ,cbody)))))