javascript - Debugging with chrome with es6 -
i trying use ecmascript 2015 project , finding hard add breakpoints @ specific places (places thought logical have breakpoint).
i have #enable-javascript-harmony flag in chrome set true (if helps), using babeljs transpile , have sourcemaps directly set breakpoints in file want debug. doing wrong can point me making mistake.
for reference have added gif of talking about.
the problem source code (via source maps) real code mapping. while source concise , dense, generated code typically longer , mapping between 2 isn't (and cannot be) done in way guarantee 1:1 relationship between two.
so when try place breakpoint in single line statement such (foo) => bar
, actual executed code @ least few lines long , assume (and don't know!) devtools tries place real breakpoint on first line of real, running code. - in turn fails expressions.
it inherent disadvantage of generated code , applies compile-to-js languages source maps. unfortunately, i'm not aware of workaround. last resort in these cases turn off source maps in browser , step through real, generated code.
hope helps :/
Comments
Post a Comment