• What if you declare b in line 22 var b = require('b').create();, does it make a difference?

    No, but a mix version of es6 and stable like this works:

    // es6 code version
    Modules.addCached("b",(()=>{
      var _b,
          //  b = () => {_b = this;},
          b = function() {_b = this;},   // <---
          pb = b.prototype;
      pb.sqrt = (a) => {return _b._sqrt(a);};
      pb._sqrt = (a) => {return Math.sqrt(a);};
      exports.create = () => { return new b();};
    }));
    b = require('b').create();
    console.log(b.sqrt(3));
    

    I guess it's a special constellation of arrow function usage that causes the interpreter to fail.

About

Avatar for MaBe @MaBe started