Skip to content

Commit

Permalink
sham of non-trapping for cross-repo testing
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jan 15, 2025
1 parent bf416a2 commit e3327b8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/marshal/src/encodeToCapData.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ export const makeEncodeToCapData = (encodeOptions = {}) => {
// work. If we allow sortable symbol keys, this will need to
// become more interesting.
const names = ownKeys(passable).sort();
// TODO either delete or at-ts-expect-error
// @ts-ignore
return fromEntries(
names.map(name => [name, encodeToCapDataRecur(passable[name])]),
);
Expand Down
2 changes: 2 additions & 0 deletions packages/marshal/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export {};

/**
* @template T
* TODO either delete or at-ts-expect-error
* // @ts-ignore
* @typedef {{ '@qclass': T }} EncodingClass
*/

Expand Down
3 changes: 2 additions & 1 deletion packages/pass-style/src/symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const wellKnownSymbolNames = new Map(
name => typeof name === 'string' && typeof Symbol[name] === 'symbol',
)
.filter(name => {
// @ts-expect-error It doesn't know name cannot be a symbol
// TODO either delete or at-ts-expect-error
// @ts-ignore It doesn't know name cannot be a symbol
!name.startsWith('@@') ||
Fail`Did not expect Symbol to have a symbol-valued property name starting with "@@" ${q(
name,
Expand Down
5 changes: 4 additions & 1 deletion packages/ses/src/error/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ export const sanitizeError = error => {
} = descs;

const restNames = ownKeys(restDescs);
// TODO why did this start warning?
// eslint-disable-next-line @endo/restrict-comparison-operands
if (restNames.length >= 1) {
for (const name of restNames) {
delete error[name];
Expand All @@ -305,7 +307,8 @@ export const sanitizeError = error => {
);
}
for (const name of ownKeys(error)) {
// @ts-expect-error TS still confused by symbols as property names
// TODO either delete or at-ts-expect-error
// @ts-ignore TS still confused by symbols as property names
const desc = descs[name];
if (desc && objectHasOwnProperty(desc, 'get')) {
defineProperty(error, name, {
Expand Down
4 changes: 3 additions & 1 deletion packages/ses/src/make-hardener.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ export const makeHardener = () => {
// NOTE: Calls getter during harden, which seems dangerous.
// But we're only calling the problematic getter whose
// hazards we think we understand.
// @ts-expect-error TS should know FERAL_STACK_GETTER
//
// TODO either delete or at-ts-expect-error
// @ts-ignore TS should know FERAL_STACK_GETTER
// cannot be `undefined` here.
// See /~https://github.com/endojs/endo/pull/2232#discussion_r1575179471
value: apply(FERAL_STACK_GETTER, obj, []),
Expand Down

0 comments on commit e3327b8

Please sign in to comment.