dev_compiler icon indicating copy to clipboard operation
dev_compiler copied to clipboard

Prune stack traces

Open vsmenon opened this issue 10 years ago • 2 comments

Our stack traces should match the spec. We don't inline for now, so this really means pruning our helpers:

The active stack trace is an object whose toString() method produces a string that is a record of exactly those function activations within the current isolate that had not completed execution at the point where the current exception (16.9) was thrown. This implies that no synthetic function activations may be added to the trace, nor may any source level activations be omitted. This means, for example, that any inlining of functions done as an optimization must not be visible in the trace. Similarly, any synthetic routines used by the implementation must not appear in the trace.

vsmenon avatar Jul 14 '15 18:07 vsmenon

This should also include fixing our constructor stack traces. Our current constructor scheme shows up like this:

dev_compiler/runtime/_operations.js 287:25  Object.captureStackTrace
dev_compiler/runtime/dart/core.js 627:12    NoAnnotationError.<fn>
dev_compiler/runtime/dart/core.js 609:24    NoAnnotationError.Error
angular2/src/facade/lang.js 291:13          NoAnnotationError.BaseException
angular2/src/di/exceptions.js 130:13        NoAnnotationError
dev_compiler/runtime/dart/core.js 17:28     NoAnnotationError.Object
dev_compiler/runtime/dart/core.js 607:3     Error
angular2/src/facade/lang.js 280:3           BaseException
angular2/src/di/exceptions.js 126:3         NoAnnotationError
angular2/src/di/binding.js 168:13           _extractToken

vsmenon avatar Jul 14 '15 18:07 vsmenon

I wonder if JS has thought about this in the context of ES6 classes. Seems like it will become more common with subclassing.

jmesserly avatar Jul 14 '15 19:07 jmesserly