Skip to content

Commit

Permalink
fix: @W-12489598 detect minification from function name and not comme…
Browse files Browse the repository at this point in the history
…nt removal (#419)
  • Loading branch information
jdalton authored Feb 9, 2023
1 parent e6cebae commit ef26702
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion packages/near-membrane-base/src/membrane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ export function createMembraneMarshall(
// phase two, the user opted-in to custom devtools formatters. Phase one
// is used for light weight initialization time debug while phase two is
// reserved for post initialization runtime.
const LOCKER_UNMINIFIED_FLAG = `${() => /* $LWS */ 1}`.includes('*');

// eslint-disable-next-line @typescript-eslint/naming-convention
const LOCKER_UNMINIFIED_FLAG = `${(function LOCKER_UNMINIFIED_FLAG() {
return LOCKER_UNMINIFIED_FLAG.name;
})()}`.includes('LOCKER_UNMINIFIED_FLAG');
// Indicate whether debug support is available.
const LOCKER_DEBUGGABLE_FLAG = LOCKER_UNMINIFIED_FLAG && !IS_IN_SHADOW_REALM;
// BigInt is not supported in Safari 13.1.
Expand Down
8 changes: 5 additions & 3 deletions packages/near-membrane-shared/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ export const LOCKER_IDENTIFIER_MARKER = '$LWS';
// phase two, the user opted-in to custom devtools formatters. Phase one
// is used for light weight initialization time debug while phase two is
// reserved for post initialization runtime.

// istanbul ignore next
export const LOCKER_UNMINIFIED_FLAG = `${() => /* $LWS */ 1}`.includes(LOCKER_IDENTIFIER_MARKER);
export const LOCKER_UNMINIFIED_FLAG =
// eslint-disable-next-line @typescript-eslint/naming-convention
/* istanbul ignore next */ `${(function LOCKER_UNMINIFIED_FLAG() {
return LOCKER_UNMINIFIED_FLAG.name;
})()}`.includes('LOCKER_UNMINIFIED_FLAG');
export const CHAR_ELLIPSIS = '\u2026';
export const TO_STRING_BRAND_ARRAY = '[object Array]';
export const TO_STRING_BRAND_ARRAY_BUFFER = '[object ArrayBuffer]';
Expand Down

0 comments on commit ef26702

Please sign in to comment.