incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Mueller <pmue...@gmail.com>
Subject Re: landed [CB-280] Improve layout of cordova-js scripts
Date Thu, 22 Mar 2012 21:17:01 GMT
One of the things you'll notice when you do a build in
incubator-cordova-js, is that we build "debug" versions of all the
platforms.  This is intended as an aid for debugging.  See [1]  and [2]
(the //@sourceurl bits, not the sourcemap bits).  We don't need to ship
these, but these might help you out if you want to, and can, debug for your
platform.  You'll see the individual files in the debugger instead of the
big concatenated mess.  The debug versions will also quickly show you what
the components of the concatenated files are, since it's one module per
line.

Browserify makes use of the same trick.

And, turns out, this helps out with debugging 'jake test' as well.  Totally
blew my mind, as I was getting some exceptions in there yesterday, but the
stack traces were total crap [3].  I tried using the 'debug' version of the
'test' platform and - whoa - all the stack traces had real file names and
line numbers!  Turns out, internally, even v8 takes advantage of the
//@sourceurl "pragma".

I think I noticed the line numbers were one or two off; need to remove the
extra \n chars in the modules we're generating, or something.  Will fix
later.

[1]
http://pmuellr.blogspot.com/2011/11/debugging-concatenated-javascript-files.html
[2] http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
[3] https://gist.github.com/2146664

-- 
Patrick Mueller
http://muellerware.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message