New: We now support source maps when compiling both from command line and in browsers.

To add source maps add the ”-S” flag to the Jake file when compiling from command line. In the browser you need to add the compiler option into your index.html file. It should look something like this:
OBJJ_COMPILER_FLAGS = [... , "SourceMap"];

All browsers has support for source maps but currently Chrome works best.
This commit is contained in:
Martin Carlberg committed 2017-09-11 12:49:59 +02:00
1 parent 033e8583db
commit 94a5995197
7 files changed
+3214 -43

No files matched your search

+7 -3
View File
@@ -248,7 +248,8 @@ function decompile(/*String*/ aString, /*CFURL*/ aURL)
*/
var marker = NULL,
code = "",
dependencies = [];
dependencies = [],
sourceMap;
while (marker = stream.getMarker())
{
@@ -262,14 +263,17 @@ function decompile(/*String*/ aString, /*CFURL*/ aURL)
else if (marker === MARKER_IMPORT_LOCAL)
dependencies.push(new FileDependency(new CFURL(text), YES));
else if (marker === MARKER_SOURCE_MAP)
sourceMap = text;
}
var fn = FileExecutable._lookupCachedFunction(aURL);
if (fn)
return new Executable(code, dependencies, aURL, fn);
return new Executable(code, dependencies, aURL, fn, null, null, sourceMap);
return new Executable(code, dependencies, aURL);
return new Executable(code, dependencies, aURL, null, null, null, sourceMap);
}
var FunctionCache = { };