endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
762 stars 68 forks source link

refactor(pass-style): better non-remotable function error #2267

Closed erights closed 2 months ago

erights commented 2 months ago

closes: #XXXX refs: https://github.com/Agoric/agoric-sdk/pull/9097

Description

As the changed test case demonstrates, before this PR, testing the passStyleOf a normal unmarked function was correctly rejected, but with a terrible error message, such as:

This change aligns with the error message already used for an unmarked objects-as-closure object. For an unmarked function, the error would be

Security Considerations

none

Scaling Considerations

none

Documentation Considerations

none

Testing & Compatibility Considerations

There might be tests with golden text based on the old error message. These tests would need to be revised to the new text. During the transition, golden text error tests should use a regexp to be compat with both the before and after of this PR, with a link to the PR itself so we know when we can clean it up.

I found three such dependencies. One in endo, which this PR fixes. None in agoric-sdk master. Two in https://github.com/Agoric/agoric-sdk/pull/9097 , both of which have now been revised to be compat before and after.

Upgrade Considerations

none