diff --git a/src/de/inetsoftware/jwebassembly/sourcemap/SourceMapWriter.java b/src/de/inetsoftware/jwebassembly/sourcemap/SourceMapWriter.java index ce73646e..ac788451 100644 --- a/src/de/inetsoftware/jwebassembly/sourcemap/SourceMapWriter.java +++ b/src/de/inetsoftware/jwebassembly/sourcemap/SourceMapWriter.java @@ -188,7 +188,7 @@ private class Generator { void appendLineMappings() throws IOException { out.append( '\"' ); for( SourceMapping mapping : mappings ) { - int generatedLine = 1; // ever 1 for WebAssembly + int generatedLine = 0; // ever 1 for WebAssembly but line one is coded as zero int generatedColumn = mapping.getGeneratedColumn(); if( generatedLine > 0 && previousLine != generatedLine ) { diff --git a/src/de/inetsoftware/jwebassembly/sourcemap/SourceMapping.java b/src/de/inetsoftware/jwebassembly/sourcemap/SourceMapping.java index 1fcd0bb1..adcea847 100644 --- a/src/de/inetsoftware/jwebassembly/sourcemap/SourceMapping.java +++ b/src/de/inetsoftware/jwebassembly/sourcemap/SourceMapping.java @@ -37,7 +37,7 @@ public class SourceMapping { */ public SourceMapping( int generatedColumn, int sourceLine, String sourceFileName ) { this.generatedColumn = generatedColumn; - this.sourceLine = sourceLine; + this.sourceLine = sourceLine - 1; // The first line is coded as zero this.sourceFileName = sourceFileName; }