getsentry / rust-sourcemap

A library for rust that implements basic sourcemap handling
Other
224 stars 27 forks source link

Bug in `SourceMapIndex::flatten` #73

Closed loewenheim closed 1 year ago

loewenheim commented 1 year ago

index-map.zip

The attached zip file contains an index sourcemap (index.android.bundle.map) and its flattened form (flattened.map). Looking up line 154, column 1938 in the original map correctly yields

lookup line: 153, column: 1937:
  name: "Error"
  source file: "/Users/krystofwoldrich/random/ram-bundle-sentry-test/sentry-test/App.tsx"
  source line: 92
  source column: 42
  minified line: 0
  minified column: 1932
  original function: not found
  source line:
    Sentry.captureException(new Error('First error'));

but looking up the same line and column in the flattened map yields

lookup line: 153, column: 1937:
  name: "white"
  source file: "/Users/krystofwoldrich/random/ram-bundle-sentry-test/sentry-test/App.tsx"
  source line: 87
  source column: 64
  minified line: 153
  minified column: 1935
  original function: not found
  source line:
    backgroundColor: isDarkMode ? Colors.black : Colors.white,