See Agoric/agoric-sdk#4767 (comment)
At the time of writing, the code that appears there is
const weakRefDeref = WeakRef && WeakRef.prototype.deref;
part of whose purpose is to be conditional on whether there is a WeakRef variable in scope. According to the SES semantics this code is incorrect. If there is no WeakRef variable in scope, it should throw a ReferenceError instead. However, due to necessary limitations of the SES-shim, it returns an undefined instead. Because this code was tested only on the SES-shim, this but went undetected until it was spotted during a manual review.
This bug itself cannot be fixed in the SES-shim at reasonable engineering cost, so I don't expect it to be closed. I file it as a caution against falling into this trap.
See Agoric/agoric-sdk#4767 (comment)
At the time of writing, the code that appears there is
part of whose purpose is to be conditional on whether there is a
WeakRefvariable in scope. According to the SES semantics this code is incorrect. If there is noWeakRefvariable in scope, it should throw aReferenceErrorinstead. However, due to necessary limitations of the SES-shim, it returns anundefinedinstead. Because this code was tested only on the SES-shim, this but went undetected until it was spotted during a manual review.This bug itself cannot be fixed in the SES-shim at reasonable engineering cost, so I don't expect it to be closed. I file it as a caution against falling into this trap.