   (id nil :read-only t)
 
   ;; Process to which this thing belongs
-  (process nil))
+  (process nil :read-only t))
+
+(defun espresso--js-handle-expired-p (x)
+  (not (eq (espresso--js-handle-process x)
+           (inferior-moz-process))))
 
 (defvar espresso--js-references nil
   "Maps Elisp Javascript proxy objects to their Javascript IDs.")

                           ,@(espresso--optimize-arglist (list value))
                           ))
                    (js-handle? (arg) `(espresso--js-handle-p ,arg)))
           (symbol-macrolet ((js-array-as-list espresso--js-array-as-list))
             ,@forms))
       (espresso--js-leave-repl))))

(defvar espresso--js-array-as-list nil

(put 'espresso-js-error 'error-conditions '(error js-error))
(put 'espresso-js-error 'error-message "Javascript Error")

(defun espresso--wait-for-matching-output
  (process regexp timeout &optional start)
  "Wait TIMEOUT seconds for PROCESS to output something that
matches REGEXP. On timeout, return nil. On success, return t with
match data set. If START is non-nil, look for output starting
