use impersonator-ephemeron to allow a

real contract on preferences:add-callback
This commit is contained in:
Robby Findler 2013-02-18 18:42:59 -06:00
parent 796550bd9f
commit 164a5831b8

View File

@ -191,7 +191,7 @@ the state transitions / contracts are:
(define preferences:add-callback
(lambda (p callback [weak? #f])
(let ([new-cb (make-pref-callback (if weak?
(make-weak-box callback)
(make-weak-box (impersonator-ephemeron callback))
callback))])
(hash-set! callbacks
p
@ -365,13 +365,7 @@ the state transitions / contracts are:
(proc-doc/names
preferences:add-callback
(->* (symbol?
;; important that this arg only has a flat contract
;; so that no wrapper is created, so that
;; the weak box stuff works ...
(let ([procedure-with-arity2? (λ (x) (and (procedure? x) (procedure-arity-includes? x 2)))])
procedure-with-arity2?))
(->* (symbol? (-> symbol? any/c any))
(boolean?)
(-> void?))
((p f)