mirror of
https://github.com/status-im/react-native.git
synced 2025-01-24 00:09:08 +00:00
Update babel-preset, filter path by identifiers.
Summary: This PR contains [the fix](https://github.com/facebook/react-native/issues/6063#issuecomment-189416771) from #6063, which resolves the issue with rxjs 5. Is there a reason to not include these proposed changes in the repo? Closes https://github.com/facebook/react-native/pull/10815 Differential Revision: D4226835 fbshipit-source-id: bfaeaebbe308c45bce814469ef0f75283f050d18
This commit is contained in:
parent
6fef014295
commit
2121527cb8
@ -24,12 +24,12 @@ module.exports = function symbolMember(babel) {
|
||||
return {
|
||||
visitor: {
|
||||
MemberExpression(path) {
|
||||
let node = path.node;
|
||||
|
||||
if (!isAppropriateMember(node)) {
|
||||
if (!isAppropriateMember(path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let node = path.node;
|
||||
|
||||
path.replaceWith(
|
||||
t.conditionalExpression(
|
||||
t.binaryExpression(
|
||||
@ -54,8 +54,11 @@ module.exports = function symbolMember(babel) {
|
||||
};
|
||||
};
|
||||
|
||||
function isAppropriateMember(node) {
|
||||
return node.object.type === 'Identifier' &&
|
||||
function isAppropriateMember(path) {
|
||||
let node = path.node;
|
||||
|
||||
return path.parentPath.type !== 'AssignmentExpression' &&
|
||||
node.object.type === 'Identifier' &&
|
||||
node.object.name === 'Symbol' &&
|
||||
node.property.type === 'Identifier';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user