-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add asyncToGenerator to the babelHelper #22058
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
eslint
found some issues.
Libraries/polyfills/babelHelpers.js
Outdated
// ### asyncToGenerator ### | ||
|
||
function _asyncToGenerator(fn) { | ||
return function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Delete ·
Libraries/polyfills/babelHelpers.js
Outdated
function _asyncToGenerator(fn) { | ||
return function () { | ||
var gen = fn.apply(this, arguments); | ||
return new Promise(function (resolve, reject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Delete ·
Libraries/polyfills/babelHelpers.js
Outdated
if (info.done) { | ||
resolve(value); | ||
} else { | ||
return Promise.resolve(value).then(function (value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Replace function·
with ⏎············function
Libraries/polyfills/babelHelpers.js
Outdated
if (info.done) { | ||
resolve(value); | ||
} else { | ||
return Promise.resolve(value).then(function (value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-shadow: 'value' is already declared in the upper scope.
Libraries/polyfills/babelHelpers.js
Outdated
resolve(value); | ||
} else { | ||
return Promise.resolve(value).then(function (value) { | ||
step('next', value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Insert ··
Libraries/polyfills/babelHelpers.js
Outdated
} else { | ||
return Promise.resolve(value).then(function (value) { | ||
step('next', value); | ||
}, function (err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Replace },·function·
with ··},⏎············function
Libraries/polyfills/babelHelpers.js
Outdated
return Promise.resolve(value).then(function (value) { | ||
step('next', value); | ||
}, function (err) { | ||
step('throw', err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Insert ··
Libraries/polyfills/babelHelpers.js
Outdated
step('next', value); | ||
}, function (err) { | ||
step('throw', err); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Replace }
with ··},⏎··········
Libraries/polyfills/babelHelpers.js
Outdated
return step('next'); | ||
}); | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-extra-semi: Unnecessary semicolon.
Libraries/polyfills/babelHelpers.js
Outdated
return step('next'); | ||
}); | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Delete ;
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code analysis results:
eslint
found some issues.
} | ||
|
||
if (info.done) { | ||
resolve(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-shadow: 'value' is already declared in the upper scope.
I don't think this is necessary now that RN 0.57 uses the babel runtime instead of the helpers in this file. See #21283. |
Closing as per the last comment, agree this shouldn't be necessary. |
This is an existing problem which is discussed in this issue
Release Notes:
Help reviewers and the release process by writing your own release notes. See below for an example.
[GENERAL] [ENHANCEMENT] [Polyfills] - Add asyncToGenerator to the babelHelper