How This Example Works
The RangeError is thrown in _outlinedUsingBlock (the outlined using block of reserveOrder, with reserveLine and assertValidQuantity inlined into it). It is called through the runtime helper __using, from submitOrder, which in turn has reserveOrder inlined.
The raw err.stack only knows the generated frames. DevTools should expand inlined frames, merge the outlined block into its owner, drop the helper, and show each authored frame once.
What to Try & Verify in DevTools
Try:Click Catch & console.error() and expand the error in the Console.
- Stack:
assertValidQuantity(6) →reserveLine(11) →reserveOrder(21) →submitOrder(27) →submitOrderAndReport(33), all linking toerrors.ts. - No generated frames:
_outlinedUsingBlockand__usingare not shown, andreserveOrdershows up exactly once. - Raw vs. symbolized: the page readout shows the raw
err.stackwithbundle.jsframes. Only DevTools symbolizes it.
Try:Click Throw Uncaught Error.
- Stack:
Uncaught RangeErrorwithassertValidQuantity(6) →reserveLine(11) →reserveOrder(21) →submitOrder(27) → anonymous timer callback (41). - Async part:
setTimeout→submitOrderLater(41).window.runExample06is not shown.
Try:In Sources › Breakpoints, enable Pause on uncaught exceptions and click Throw Uncaught Error again (or enable Pause on caught exceptions and use the other button).
- Paused on line 6 of
errors.ts. The Call Stack matches the Console stack trace. - Select
reserveOrder: Scope shows Blocklock, andorderId<unavailable>,sku: "SKU-B",quantity: 0,reserved: 0. - Select
submitOrder:unitsis<unavailable>(not assigned yet).
Other things to try
- Right-click the stack trace in the Console or Call Stack › Copy stack trace.
- Add
bundle.jsto the ignore list, or toggle the source map scopes experiment, and compare the stack traces. - Close DevTools, click both buttons, then open DevTools: the already-logged errors should still get symbolized.
- While paused on the exception, use Restart frame on
reserveOrderorsubmitOrder.
Not sure if it's a DevTools bug? Tab 4. Decoded Scopes shows what the source map actually encodes.
Try in the Console While Paused
While paused, select a frame and evaluate these in the Console (Esc opens the drawer) using the authored names:
`${sku} x ${quantity}`
orderId