Skip to content

Commit 957db3f

Browse files
author
Mihail Slavchev
committed
add try-catch block when traverse for TypeScript extend function
1 parent 8eada05 commit 957db3f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • build/project-template-gradle/build-tools/android-static-binding-generator/ast-parser/visitors

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ var es5_visitors = (function () {
9999
function traverseTsExtend(path, config) {
100100

101101
//this is the information for a normal extend
102-
var extendClass = _getArgumentFromNodeAsString(path, 5, config)
102+
var extendClass;
103+
try {
104+
extendClass = _getArgumentFromNodeAsString(path, 5, config)
105+
} catch (e) {
106+
config.logger.info(e)
107+
return;
108+
}
103109
var overriddenMethodNames = _getOverriddenMethodsTypescript(path, 3)
104110
var extendParent = _getParrent(path, 1, config);
105111
var declaredClassName = "";
@@ -362,7 +368,7 @@ var es5_visitors = (function () {
362368
}
363369
else {
364370
throw {
365-
message: "Node type is not a call expression. File" + config.filePath,
371+
message: "Node type is not a call expression. File=" + config.filePath + " line=" + path.node.loc.start.line,
366372
errCode: 1
367373
}
368374
}

0 commit comments

Comments
 (0)