Steps to replicate the issue (include links if applicable):
- Given:
- wfLoadExtension('MultimediaViewer')
- $wgUseInstantCommons = true; (or upload a local image)
- [[File:Examp.jpg]] on the main page
- add throw new Error('x'); at the top of mmv.lightboxinterface.js
- view Main Page
What happens?:
Stack trace is not mapped. Likewise, setting a debugger; breakpoint in an event handler and triggering it leads the browser to pause in invisible space after the end of a file.
Other information (browser name/version, screenshots, etc.):
I narrowed it down by removing and restoring large chunks of code alternatingly until narrowing it down to a multi line backtick string literal in mmv.ui.canvas.js.
Minimal repro:
$wgResourceModules['krinkle'] = [ 'scripts' => [ [ 'name' => 'a.js', 'content' => "var str = `foo\nbar`;\n" ], [ 'name' => 'b.js', 'content' => "throw new Error('x');\n" ], ] ]; $wgHooks['BeforePageDisplay'][] = function ( $out ) { $out->addModules('krinkle'); };
In this way, the error trace is not mapped. If you remove the \n in foo\nbar, the error ends up mapped (correctly) to b.js.