mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	unminify: Clean up unnecessary repetition of webpack:/// URLs.
This takes stacktrace lines that used to look like this: n@https://chat.zulip.org/static/webpack-bundles/app.2385793af60f0b082ee9.js:1:12680 = webpack:///./static/js/blueslip.js line 241 column 1 dispatch@https://chat.zulip.org/static/webpack-bundles/app.2385793af60f0b082ee9.js:52:37878 = webpack:////srv/zulip-npm-cache/8ea4cd291dd23441aec0f298b77b6ddc0d0a7a56/node_modules/jquery/dist/jquery.js line 5182 column 1 to have the even-numbered lines look like this: = ./static/js/blueslip.js line 241 column 1 dispatch@https://chat.zulip.org/static/webpack-bundles/app.2385793af60f0b082ee9.js:52:37878 = /srv/zulip-npm-cache/8ea4cd291dd23441aec0f298b77b6ddc0d0a7a56/node_modules/jquery/dist/jquery.js line 5182 column 1
This commit is contained in:
		@@ -40,8 +40,12 @@ class SourceMap:
 | 
			
		||||
                # The sourcemap lib is 0-based, so subtract 1 from line and col.
 | 
			
		||||
                try:
 | 
			
		||||
                    result = index.lookup(line=gen_line-1, column=gen_col-1)
 | 
			
		||||
                    display_src = result.src
 | 
			
		||||
                    webpack_prefix = "webpack:///"
 | 
			
		||||
                    if display_src.startswith(webpack_prefix):
 | 
			
		||||
                        display_src = display_src[len(webpack_prefix):]
 | 
			
		||||
                    out += ('       = %s line %d column %d\n' %
 | 
			
		||||
                            (result.src, result.src_line+1, result.src_col+1))
 | 
			
		||||
                            (display_src, result.src_line+1, result.src_col+1))
 | 
			
		||||
                except IndexError:
 | 
			
		||||
                    out += '       [Unable to look up in source map]\n'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user