@@ -54,27 +54,6 @@ export default class Mappings {
5454 let charInHiresBoundary = false ;
5555
5656 while ( originalCharIndex < chunk . end ) {
57- if ( this . hires || first || sourcemapLocations . has ( originalCharIndex ) ) {
58- const segment = [ this . generatedCodeColumn , sourceIndex , loc . line , loc . column ] ;
59-
60- if ( this . hires === 'boundary' ) {
61- // in hires "boundary", group segments per word boundary than per char
62- if ( wordRegex . test ( original [ originalCharIndex ] ) ) {
63- // for first char in the boundary found, start the boundary by pushing a segment
64- if ( ! charInHiresBoundary ) {
65- this . rawSegments . push ( segment ) ;
66- charInHiresBoundary = true ;
67- }
68- } else {
69- // for non-word char, end the boundary by pushing a segment
70- this . rawSegments . push ( segment ) ;
71- charInHiresBoundary = false ;
72- }
73- } else {
74- this . rawSegments . push ( segment ) ;
75- }
76- }
77-
7857 if ( original [ originalCharIndex ] === '\n' ) {
7958 loc . line += 1 ;
8059 loc . column = 0 ;
@@ -83,6 +62,27 @@ export default class Mappings {
8362 this . generatedCodeColumn = 0 ;
8463 first = true ;
8564 } else {
65+ if ( this . hires || first || sourcemapLocations . has ( originalCharIndex ) ) {
66+ const segment = [ this . generatedCodeColumn , sourceIndex , loc . line , loc . column ] ;
67+
68+ if ( this . hires === 'boundary' ) {
69+ // in hires "boundary", group segments per word boundary than per char
70+ if ( wordRegex . test ( original [ originalCharIndex ] ) ) {
71+ // for first char in the boundary found, start the boundary by pushing a segment
72+ if ( ! charInHiresBoundary ) {
73+ this . rawSegments . push ( segment ) ;
74+ charInHiresBoundary = true ;
75+ }
76+ } else {
77+ // for non-word char, end the boundary by pushing a segment
78+ this . rawSegments . push ( segment ) ;
79+ charInHiresBoundary = false ;
80+ }
81+ } else {
82+ this . rawSegments . push ( segment ) ;
83+ }
84+ }
85+
8686 loc . column += 1 ;
8787 this . generatedCodeColumn += 1 ;
8888 first = false ;
0 commit comments