diff --git a/packages/metro-bundler/src/Resolver/polyfills/babelHelpers.js b/packages/metro-bundler/src/Resolver/polyfills/babelHelpers.js index 1390ef6d..51cb4523 100644 --- a/packages/metro-bundler/src/Resolver/polyfills/babelHelpers.js +++ b/packages/metro-bundler/src/Resolver/polyfills/babelHelpers.js @@ -63,6 +63,16 @@ babelHelpers.createClass = (function () { }; })(); +babelHelpers.defineEnumerableProperties = function(obj, descs) { + for (var key in descs) { + var desc = descs[key]; + desc.configurable = (desc.enumerable = true); + if ('value' in desc) desc.writable = true; + Object.defineProperty(obj, key, desc); + } + return obj; +}; + babelHelpers.defineProperty = function (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, {