Skip to content

Commit

Permalink
feat
Browse files Browse the repository at this point in the history
  • Loading branch information
yexi-xf committed Apr 15, 2022
1 parent ea72f12 commit a03a3af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/gogocode-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gogocode",
"version": "1.0.52",
"version": "1.0.53",
"description": "The simplest tool to parse/transform/generate code on ast",
"keywords": [
"babel",
Expand Down
19 changes: 12 additions & 7 deletions packages/gogocode-core/src/js-core/get-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,18 @@ function getSelector(selectorCode, parseOptions, expando) {
//
}
} else if (selector.nodeType == 'MemberExpression') {
const selectorAstList = [selector]
const classPropSelector = { nodeType: '', structure: {} };
const classPropSelectorAst = parse(`type a = ${selectorCode}`, parseOptions).program.body[0].typeAnnotation.typeName
classPropSelector.nodeType = classPropSelectorAst.type;
filterProps(classPropSelectorAst, classPropSelector.structure);
selectorAstList.push(classPropSelector);
return selectorAstList;
try {
const selectorAstList = [selector]
const classPropSelector = { nodeType: '', structure: {} };
const classPropSelectorAst = parse(`type a = ${selectorCode}`, parseOptions).program.body[0].typeAnnotation.typeName
classPropSelector.nodeType = classPropSelectorAst.type;
filterProps(classPropSelectorAst, classPropSelector.structure);
selectorAstList.push(classPropSelector);
return selectorAstList;
} catch(e) {
// maybe selectorCode = this.xxx
}

}
return selector;
}
Expand Down

0 comments on commit a03a3af

Please sign in to comment.