replaced truthy test with more specific hasOwnProperty() in generator