You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To recreate this problem, create the following 3 files, and run node test.js.
Rewiring the "Car" module again after changing the composed "Engine" instance returns a fresh Car instance, but the rewired change to the composed "Engine" via __set__ is persisted in the "fresh" instance.
// Engine.js
class Engine {
start() {
return 'engine started';
}
}
module.exports = new Engine();
// Car.js
const engine = require('./Engine');
class Car {
constructor( engine ) {
this.engine = engine;
}
}
const car = new Car( engine );
module.exports = car;
To recreate this problem, create the following 3 files, and run
node test.js
.Rewiring the "Car" module again after changing the composed "Engine" instance returns a fresh Car instance, but the rewired change to the composed "Engine" via
__set__
is persisted in the "fresh" instance.The text was updated successfully, but these errors were encountered: