The built in functions can't be called using "call", and that is probably causing you issues.
I also don't think that prototype.constructor is honoured at the moment (I need to look at the spec to see how it should be used), but I could be wrong there.
It's probably best to just instantiate OneWire as a field in the DS18B20 module, like the existing module does.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The built in functions can't be called using "call", and that is probably causing you issues.
I also don't think that prototype.constructor is honoured at the moment (I need to look at the spec to see how it should be used), but I could be wrong there.
It's probably best to just instantiate OneWire as a field in the DS18B20 module, like the existing module does.