Skip to content

Commit

Permalink
fixup! allow conflict on "harden"
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jan 18, 2025
1 parent c9dc560 commit 88b13ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/ses/src/intrinsics.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ function initProperty(obj, name, desc) {
preDesc.enumerable !== desc.enumerable ||
preDesc.configurable !== desc.configurable
) {
throw TypeError(`Conflicting definitions of ${name}`);
if (name !== 'harden') {
throw TypeError(`Conflicting definitions of ${name}`);
}
}
}
defineProperty(obj, name, desc);
Expand Down
6 changes: 4 additions & 2 deletions packages/ses/src/make-hardener.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
String,
TypeError,
WeakSet,
globalThis,
// globalThis, // if we suppress native harden
apply,
arrayForEach,
defineProperty,
Expand Down Expand Up @@ -241,7 +241,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 remove or at-ts-expect-error
// @ts-ignore-error 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 88b13ad

Please sign in to comment.