evanw / evanw/node-source-map-support
Only first line working?
- Lenguaje dominante
- JavaScript
- Estrellas
- 2.2k
- Forks
- 223
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
`node v8.0.0`
src/throw-err.js (not compiled)
```javascript
import 'source-map-support/register'
const main = async () => {
throw new Error('wooot')
}
main().catch(console.error)
```
lib/throw-err.js (compiled with babel)
```javascript
'use strict';
require('source-map-support/register');
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
const main = (() => {
var _ref = _asyncToGenerator(function* () {
throw new Error('wooot');
});
return function main() {
return _ref.apply(this, arguments);
};
})();
main().catch(console.error);
//# sourceMappingURL=throw-err.js.map
```
lib/throw-err.js.map (source map)
```json
{"version":3,"sources":["../src/throw-err.js"],"names":["main","Error","catch","console","error"],"mappings":";;AAAA;;;;AAEA,MAAMA;AAAA,+BAAO,aAAY;AACvB,UAAM,IAAIC,KAAJ,CAAU,OAAV,CAAN;AACD,GAFK;;AAAA;AAAA;AAAA;AAAA,IAAN;;AAIAD,OAAOE,KAAP,CAAaC,QAAQC,KAArB","file":"throw-err.js","sourcesContent":["import 'source-map-support/register'\n\nconst main = async () => {\n throw new Error('wooot')\n}\n\nmain().catch(console.error)\n"]}
```
```
$ node lib/throw-err.js
Error: wooot
at /Users/olalonde/code/binded/filepunk/src/throw-err.js:4:9
at Generator.next ()
at step (/Users/olalonde/code/binded/filepunk/lib/throw-err.js:5:191)
at /Users/olalonde/code/binded/filepunk/lib/throw-err.js:5:437
at Promise ()
at /Users/olalonde/code/binded/filepunk/lib/throw-err.js:5:99
at main (/Users/olalonde/code/binded/filepunk/src/throw-err.js:3:7)
at Object. (/Users/olalonde/code/binded/filepunk/src/throw-err.js:7:1)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
```
Why Is only the first line of the stack trace correct? `at Generator.next ()` and lines with `lib/` should not be there.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Reproduce el informe con Node v8 ejecutando el lib/throw-err.js mostrado, usando src/throw-err.js y su throw-err.js.map como entradas de referencia. Comienza en source-map-support/register e inspecciona cómo se mapea el stack; el trabajo estará terminado cuando el stack de errores asíncrono ya no incluya Generator.next ni frames de lib/ al ejecutar este ejemplo.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, node.js
- Área
- devtools
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100