https://bugzilla.wikimedia.org/show_bug.cgi?id=46426
--- Comment #5 from Krinkle <[email protected]> --- (In reply to comment #4) > Much more likely to be something changed in ResourceLoader that it now chokes > on the unclosed comment at the end of their MediaWiki:Common.js. I can't see > any possible way this could be related to Scribunto. > > The "Error: JavaScript parse error: Parse error: Missing ; before statement > in file 'MediaWiki:Common.js' on line 1149" message comes from > includes/resourceloader/ResourceLoaderModule.php line 422. > > I'm going to reassign this to ResourceLoader, where hopefully someone knows > more about what might have made this start failing where it didn't before. Afaik this behaviour has not changed in ResourceLoader for over a year. If it did change, it seems like it fixed a bug, not introduced a bug. An unclosed comment in javascript (not the validation by ResourceLoader, but when executing code in a real browser engine I mean) results in a "SyntaxError: Unexpected token ILLEGAL". Try executing the following in your browser's javascript console: function foo() { return 4; } alert(foo); /* bla Which means, if ResourceLoader hadn't detected this on the server side (it has a javascript parser that detects syntax errors like this) one of two things would've happened: 1) It gets minified against something else which (if you're lucky) causes a big chunk of code to be incorrectly commented out until it finds a */ token somewhere that closes it. This will break code in weird and unexpected ways 2) There is no future */ token, it is the last script in the row. It gets delivered and causes a fatal error. The entire script package (anything concatenated before this) is ignored and not executed. Both are bad. What ResourceLoader does in this case: Replace the code of the wiki page that caused the error with a line that logs the error to the console. That way everything else still works and a developer can find the error without breaking the site. Again, afaik nothing changed and this never worked in the first place. If it did, it was likely by very lucky accident. -- You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug. You are watching all bug changes. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
