apollo-server-core: use getOwnPropertyNames to stay es5

This commit is contained in:
Evans Hauser 2018-05-03 17:44:53 -07:00
parent 26c09e1b1b
commit 1f3103b5c7
No known key found for this signature in database
GPG key ID: 88AF586817F52EEC

View file

@ -102,7 +102,7 @@ export function fromGraphQLError(error: GraphQLError, options?: ErrorOptions) {
//copy the original error, while keeping all values non-enumerable, so they //copy the original error, while keeping all values non-enumerable, so they
//are not printed unless directly referenced //are not printed unless directly referenced
Object.defineProperty(copy, 'originalError', { value: {} }); Object.defineProperty(copy, 'originalError', { value: {} });
Reflect.ownKeys(error).forEach(key => { Object.getOwnPropertyNames(error).forEach(key => {
Object.defineProperty(copy.originalError, key, { value: error[key] }); Object.defineProperty(copy.originalError, key, { value: error[key] });
}); });