Skip to content

Commit ef26702

Browse files
authored
fix: @W-12489598 detect minification from function name and not comment removal (#419)
1 parent e6cebae commit ef26702

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

packages/near-membrane-base/src/membrane.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ export function createMembraneMarshall(
189189
// phase two, the user opted-in to custom devtools formatters. Phase one
190190
// is used for light weight initialization time debug while phase two is
191191
// reserved for post initialization runtime.
192-
const LOCKER_UNMINIFIED_FLAG = `${() => /* $LWS */ 1}`.includes('*');
192+
193+
// eslint-disable-next-line @typescript-eslint/naming-convention
194+
const LOCKER_UNMINIFIED_FLAG = `${(function LOCKER_UNMINIFIED_FLAG() {
195+
return LOCKER_UNMINIFIED_FLAG.name;
196+
})()}`.includes('LOCKER_UNMINIFIED_FLAG');
193197
// Indicate whether debug support is available.
194198
const LOCKER_DEBUGGABLE_FLAG = LOCKER_UNMINIFIED_FLAG && !IS_IN_SHADOW_REALM;
195199
// BigInt is not supported in Safari 13.1.

packages/near-membrane-shared/src/constants.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ export const LOCKER_IDENTIFIER_MARKER = '$LWS';
66
// phase two, the user opted-in to custom devtools formatters. Phase one
77
// is used for light weight initialization time debug while phase two is
88
// reserved for post initialization runtime.
9-
10-
// istanbul ignore next
11-
export const LOCKER_UNMINIFIED_FLAG = `${() => /* $LWS */ 1}`.includes(LOCKER_IDENTIFIER_MARKER);
9+
export const LOCKER_UNMINIFIED_FLAG =
10+
// eslint-disable-next-line @typescript-eslint/naming-convention
11+
/* istanbul ignore next */ `${(function LOCKER_UNMINIFIED_FLAG() {
12+
return LOCKER_UNMINIFIED_FLAG.name;
13+
})()}`.includes('LOCKER_UNMINIFIED_FLAG');
1214
export const CHAR_ELLIPSIS = '\u2026';
1315
export const TO_STRING_BRAND_ARRAY = '[object Array]';
1416
export const TO_STRING_BRAND_ARRAY_BUFFER = '[object ArrayBuffer]';

0 commit comments

Comments
 (0)