Skip to content
  • Philip Chimento's avatar
    js: Module exports use ES6 scope rules · fcac2be3
    Philip Chimento authored
    We "import" modules by executing them and taking their global scope as the
    module object. In ES6, variables declared with "let" and "const" do not end
    up in the global scope any longer. Instead, they end up in the "global
    lexical scope", which is a different object. Unfortunately, this means
    breaking the way many modules export their variables, but if you want
    a symbol to be exported, you have to declare it with "var" or place it
    explicitly on the global object some other way.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781429
    fcac2be3