addyosmani / essential-js-design-patterns

Repo for my 'Learning JavaScript Design Patterns' book
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
4.8k stars 791 forks source link

Allow CareFactory fallback to default vehicleType #138

Closed Sequoia closed 10 years ago

Sequoia commented 10 years ago

As written, the code would set a defualt type on the VehicleFactory prototype but would not ever use it because it is overridden in the constructor. This also made switching the default value to Truck in truck factory pointless, as the constructer overrode this as well

addyosmani commented 10 years ago

Thanks for catching this. Landing the fix!