Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interoperability with Traceur call stacks #34

Open
OliverJAsh opened this issue Oct 30, 2014 · 1 comment
Open

Interoperability with Traceur call stacks #34

OliverJAsh opened this issue Oct 30, 2014 · 1 comment

Comments

@OliverJAsh
Copy link

Example: https://gist.github.com/OliverJAsh/fd98c53b62eaa32f5e56

Without longjohn:

❯ node traceur-runner.js main.js

/Users/Oliver/Development/tmp/traceur-longjohn/<compileSource>:5
var bar = () => { throw new Error('foo'); };
                        ^
Error: foo
    at bar (/Users/Oliver/Development/tmp/traceur-longjohn/<compileSource>:5:25)
    at [object Object].foo [as _onTimeout] (/Users/Oliver/Development/tmp/traceur-longjohn/<compileSource>:7:67)
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

With longjohn:

❯ node traceur-runner.js main.js
Error: foo
    at bar (/Users/Oliver/Development/tmp/traceur-longjohn/main.js:5:9)
    at foo (/Users/Oliver/Development/tmp/traceur-longjohn/main.js:10:22)
    at listOnTimeout (timers.js:112:15)
---------------------------------------------
    at foo (/Users/Oliver/Development/tmp/traceur-longjohn/main.js:9:12)
    at new Promise (eval at eval at <anonymous> (/Users/Oliver/Development/tmp/traceur-longjohn/node_modules/traceur/src/node/traceur.js:24:17))
    at foo (/Users/Oliver/Development/tmp/traceur-longjohn/main.js:8:10)
    at Object.<anonymous> (/Users/Oliver/Development/tmp/traceur-longjohn/main.js:14:1)
    at Module._compile (module.js:456:26)
    at Module._extensions..js (/Users/Oliver/Development/tmp/traceur-longjohn/node_modules/traceur/src/node/require.js:65:21)
    at Module.load (module.js:356:32)
    at Module._load (module.js:312:12)

When longjohn is enabled, the generated call stack does not respect Traceur’s call stack, which is resolved against the source maps using by traceur-source-maps. Notice how the first few lines of the longjohn call stack do not match the mappings of the original.

What is the happy path to using longjohn with Traceur? Is this something we can fix?

@OliverJAsh
Copy link
Author

I've also opened an issue on Traceur itself to discuss long stack traces: google/traceur-compiler#1481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant