Skip to content

Commit 586baef

Browse files
committed
fixed ast parser bug
1 parent 3db3503 commit 586baef

File tree

1 file changed

+3
-4
lines changed
  • build/project-template-gradle/build-tools/android-static-binding-generator/ast-parser/visitors

1 file changed

+3
-4
lines changed

build/project-template-gradle/build-tools/android-static-binding-generator/ast-parser/visitors/es5-visitors.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ var es5_visitors = (function () {
4141
if(t.isNewExpression(path)) {
4242
traverseInterface(path, config);
4343
}
44+
4445
// // Parsed Typescript to ES5 Syntax (normal extend pattern + custom extend pattern)
4546
// // anchor is __extends
4647
if(t.isIdentifier(path) && path.node.name === "__extends") {
4748
traverseTsExtend(path, config);
4849
}
49-
5050
// Maybe it's not a good idea to expose this scenario because it can be explicitly covered
5151
// //anchor is JavaProxy (optional)
5252
// var customDecoratorName = config.extendDecoratorName === undefined ? defaultExtendDecoratorName : config.extendDecoratorName;
@@ -103,7 +103,7 @@ var es5_visitors = (function () {
103103
try {
104104
extendClass = _getArgumentFromNodeAsString(path, 5, config)
105105
} catch (e) {
106-
config.logger.info(e)
106+
config.logger.info(e.message)
107107
return;
108108
}
109109
var overriddenMethodNames = _getOverriddenMethodsTypescript(path, 3)
@@ -147,11 +147,10 @@ var es5_visitors = (function () {
147147
for(var i in ci.expression.right.arguments[0].elements) {
148148
var currentDecorator = ci.expression.right.arguments[0].elements[i]
149149

150-
if(t.isCallExpression) {
150+
if(t.isCallExpression(currentDecorator)) {
151151
if(currentDecorator.callee.name === config.extendDecoratorName) {
152152
currentDecorator.callee.skipMeOnVisit = true;
153153
var customDecoratorName = config.extendDecoratorName === undefined ? defaultExtendDecoratorName : config.extendDecoratorName;
154-
155154
traverseJavaProxyExtend(currentDecorator.arguments[0].value, config, customDecoratorName, extendClass, overriddenMethodNames);
156155
return true;
157156
}

0 commit comments

Comments
 (0)