strange var behaviour while testing in local


i have something like:


var Observable = require("FuseJS/Observable");

var GUserid     = Observable(1); 

module.exports = {
  GUserid:             GUserid


var globals = require("globals");
var b = require("b");

function whatever() {
    globals.GUserid.value = "4";


var globals = require("globals");

function run() {

the first time i run it i get: 4 4 (everything is fine)

when i run it again i get: 4 1

and i keep getting 4-1 till i change the default value in globals… then i get it right (4-4) again… till i stop it and when i run it again it goes wrong…

when i run it on xcode it works fine so i guess it’s a bug from when previewing in Local.

I run it on OS X El capitan


The order in which the modules are run is undefined. The only guarantee is that a module is ran before it is required, but the order is not guaranteed to be consistent on multiple reruns/preview refreshes.’

You should not write code that depends on the initialization order of modules.