Krinkle <> changed:

           What    |Removed                     |Added
            Summary|JavaScript syntax error     |ResourceLoader: Module
                   |when        |storage containing invalid
                   |enabled when using Opera 12 |script should not cause
                   |                            |invalid loader state

--- Comment #17 from Krinkle <> ---
## Similar handling for server error

To simulate the handling for invalid syntax from the server (instead of module

* Change ResourceLoader::makeLoaderImplementScript():
  -     $scripts = new XmlJsCode( "function () {\n{$scripts}\n}" );
  +     $scripts = new XmlJsCode( "function () {throw new
Error('Wee');\n{$scripts}\n}" );
* Set $wgResourceLoaderStorageEnabled = false; in LocalSettings.php
* Refresh page


  (i) Exception thrown by jquery.hidpi
  (i) [x] Error: Wee Error {stack: (...), message: "Wee"}
  > mw.loader.getState('jquery.hidpi')
  > jQuery.byteLength

## Steps to simulate bug with client error

* Visit page that will load module x (e.g. jquery.byteLength, loaded on every
page by default in the Vector skin)
* Execute from console:

  var storeKey =;
  localStorage[storeKey] =
'throw new Error(\\"infected module store\\");

* Refresh page

Current result in console:

  [x] Uncaught Error: infected module store 
  > mw.loader.getState('jquery.byteLength')
    "loading" // indefinitely !
  > jQuery.byteLength

After this patch:

  (i) Error while evaluating data from
  (i) [x] Error: infected store Error {stack: (...), message: "infected store"} 

  > mw.loader.getState('jquery.byteLength')
  > jQuery.byteLength
    function (str) { ... }

You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
Wikibugs-l mailing list

Reply via email to