[DO NOT MERGE] feat(core): add opt-in assertion instrumentation - #6592
[DO NOT MERGE] feat(core): add opt-in assertion instrumentation#6592antonis wants to merge 11 commits into
3 issues
code-review: Found 3 issues (1 high, 2 medium)
High
String() throws TypeError on Symbol values in flattenValues - `packages/core/src/js/assertion.ts:117`
String(symbol) throws a TypeError and crashes the assertion reporter when runtime values contains a Symbol.
Medium
Sentry SDK path markers assume POSIX separators and fail on Windows - `packages/core/src/js/tools/sentryAssertionBabelPlugin.ts:120`
SENTRY_SDK_PATH_MARKERS uses forward-slash literals, but Metro/Babel filename may contain backslashes on Windows, causing the plugin to instrument the SDK's own files and inject a self-referential require('@sentry/react-native').
collectValueIdentifiers captures identifiers from nested scopes, causing ReferenceError in generated code - `packages/core/src/js/tools/sentryAssertionBabelPlugin.ts:289-293`
Identifiers bound inside nested function expressions (e.g., arrow-function parameters) are collected and then referenced in the emitted values object at the assertion call site, where they are out of scope and throw a ReferenceError at runtime.
⏱ 45m 26s · 3.0M in / 294.1k out · $3.07
Annotations
Check failure on line 117 in packages/core/src/js/assertion.ts
sentry-warden / warden: code-review
String() throws TypeError on Symbol values in flattenValues
`String(symbol)` throws a `TypeError` and crashes the assertion reporter when runtime `values` contains a Symbol.
Check warning on line 120 in packages/core/src/js/tools/sentryAssertionBabelPlugin.ts
sentry-warden / warden: code-review
Sentry SDK path markers assume POSIX separators and fail on Windows
`SENTRY_SDK_PATH_MARKERS` uses forward-slash literals, but Metro/Babel `filename` may contain backslashes on Windows, causing the plugin to instrument the SDK's own files and inject a self-referential `require('@sentry/react-native')`.
Check warning on line 293 in packages/core/src/js/tools/sentryAssertionBabelPlugin.ts
sentry-warden / warden: code-review
collectValueIdentifiers captures identifiers from nested scopes, causing ReferenceError in generated code
Identifiers bound inside nested function expressions (e.g., arrow-function parameters) are collected and then referenced in the emitted `values` object at the assertion call site, where they are out of scope and throw a `ReferenceError` at runtime.