Skip to content

Commit

Permalink
feat: conditional defining continued (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Apr 22, 2022
1 parent 40e9432 commit 822d8f4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/near-membrane-base/src/membrane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,9 @@ export function createMembraneMarshall(isInShadowRealm?: boolean) {
slice: ArrayProtoSlice,
} = ArrayCtor.prototype;
const { isView: ArrayBufferIsView } = ArrayBufferCtor;
const ArrayBufferProtoByteLengthGetter = ReflectApply(
ObjectProto__lookupGetter__,
ArrayBufferCtor.prototype,
['byteLength']
)!;
const ArrayBufferProtoByteLengthGetter = !isInShadowRealm
? ReflectApply(ObjectProto__lookupGetter__, ArrayBufferCtor.prototype, ['byteLength'])!
: undefined;
const BigIntProtoValueOf = SUPPORTS_BIG_INT ? BigInt.prototype.valueOf : undefined;
const { valueOf: BooleanProtoValueOf } = Boolean.prototype;
const { toString: ErrorProtoToString } = ErrorCtor.prototype;
Expand Down Expand Up @@ -3839,7 +3837,7 @@ export function createMembraneMarshall(isInShadowRealm?: boolean) {
// Section 25.1.5.1 get ArrayBuffer.prototype.byteLength
// https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.bytelength
// Step 2: Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
ReflectApply(ArrayBufferProtoByteLengthGetter, target, []);
ReflectApply(ArrayBufferProtoByteLengthGetter!, target, []);
return true;
// eslint-disable-next-line no-empty
} catch {}
Expand Down

0 comments on commit 822d8f4

Please sign in to comment.