Skip to content

Commit 440a2b1

Browse files
committed
Log JSParser errors with warn
1 parent d4139d8 commit 440a2b1

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

test-app/build-tools/jsparser/visitors/es5-visitors.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ var es5_visitors = (function() {
102102
try {
103103
extendClass = _getArgumentFromNodeAsString(path, 5, config)
104104
} catch (e) {
105-
config.logger.info(e.message)
105+
config.logger.warn(e.message)
106106
return;
107107
}
108108

@@ -382,7 +382,7 @@ var es5_visitors = (function() {
382382
arg1 = path.node.arguments[1];
383383
} else {
384384
throw {
385-
message: "JSParser Error: Not enough or too many arguments passed(" + path.node.arguments.length + ") when trying to extend interface: " + interfaceName + " in file: " + config.filePath,
385+
message: "JSParser Error: Not enough or too many arguments passed(" + path.node.arguments.length + ") when trying to extend interface: " + interfaceName + " in file: " + config.fullPathName,
386386
errCode: 1
387387
}
388388
}
@@ -460,15 +460,15 @@ var es5_visitors = (function() {
460460
// don't throw here, because there can be a valid js extend that has nothing to do with NS
461461
return;
462462
throw {
463-
message: "JSParser Error: Not enough or too many arguments passed(" + extendArguments.length + ") when trying to extend class: " + extendClass + " in file: " + config.filePath,
463+
message: "JSParser Error: Not enough or too many arguments passed(" + extendArguments.length + ") when trying to extend class: " + extendClass + " in file: " + config.fullPathName,
464464
errCode: 1
465465
}
466466
}
467467
} else {
468468
// don't throw here, because there can be a valid js extend that has nothing to do with NS
469469
return;
470470
throw {
471-
message: "JSParser Error: You need to call the extend with parameters. Example: '...extend(\"a.b.C\", {...overrides...})') for class: " + extendClass + " in file: " + config.filePath,
471+
message: "JSParser Error: You need to call the extend with parameters. Example: '...extend(\"a.b.C\", {...overrides...})') for class: " + extendClass + " in file: " + config.fullPathName,
472472
errCode: 1
473473
}
474474
}
@@ -484,7 +484,7 @@ var es5_visitors = (function() {
484484
var isCorrectClassName = _testClassName(className);
485485
if (className && !isCorrectClassName && !isCorrectExtendClassName) {
486486
throw {
487-
message: "JSParser Error: The 'extend' you are trying to make has an invalid name. Example: '...extend(\"a.b.C\", {...overrides...})'), for class: " + extendClass + " file: " + config.filePath,
487+
message: "JSParser Error: The 'extend' you are trying to make has an invalid name. Example: '...extend(\"a.b.C\", {...overrides...})'), for class: " + extendClass + " file: " + config.fullPathName,
488488
errCode: 1
489489
}
490490
}
@@ -517,7 +517,7 @@ var es5_visitors = (function() {
517517
// don't throw here, because there can be a valid js extend that has nothing to do with NS
518518
return;
519519
throw {
520-
message: "JSParser Error: You need to call the extend '...extend(\"extend_name\", {...overrides...})'), for class: " + extendClass + " file: " + config.filePath,
520+
message: "JSParser Error: You need to call the extend '...extend(\"extend_name\", {...overrides...})'), for class: " + extendClass + " file: " + config.fullPathName,
521521
errCode: 1
522522
}
523523
}
@@ -647,7 +647,7 @@ var es5_visitors = (function() {
647647
var o = extendedClass.node.arguments[0];
648648
} else {
649649
throw {
650-
message: "JSParser Error: Node type is not a call expression. File=" + config.filePath + " line=" + path.node.loc.start.line,
650+
message: "JSParser Error: Node type is not a call expression. File=" + config.fullPathName + " line=" + path.node.loc.start.line,
651651
errCode: 1
652652
}
653653
}
@@ -669,19 +669,19 @@ var es5_visitors = (function() {
669669
return path.parent.arguments[0].value;
670670
} else {
671671
throw {
672-
message: "JSParser Error: The first argument '" + classNameFromDecorator + "' of the " + customDecoratorName + " decorator is not following the right pattern which is: '[namespace.]ClassName'. Example: '" + customDecoratorName + "(\"a.b.ClassName\", {overrides...})', file: " + config.filePath,
672+
message: "JSParser Error: The first argument '" + classNameFromDecorator + "' of the " + customDecoratorName + " decorator is not following the right pattern which is: '[namespace.]ClassName'. Example: '" + customDecoratorName + "(\"a.b.ClassName\", {overrides...})', file: " + config.fullPathName,
673673
errCode: 1
674674
}
675675
}
676676
} else {
677677
throw {
678-
message: "JSParser Error: No arguments passed to " + customDecoratorName + " decorator. Example: '" + customDecoratorName + "(\"a.b.ClassName\", {overrides...})', file: " + config.filePath,
678+
message: "JSParser Error: No arguments passed to " + customDecoratorName + " decorator. Example: '" + customDecoratorName + "(\"a.b.ClassName\", {overrides...})', file: " + config.fullPathName,
679679
errCode: 1
680680
}
681681
}
682682
} else {
683683
throw {
684-
message: "JSParser Error: Decorator " + customDecoratorName + " must be called with parameters: Example: '" + customDecoratorName + "(\"a.b.ClassName\", {overrides...})', file: " + config.filePath,
684+
message: "JSParser Error: Decorator " + customDecoratorName + " must be called with parameters: Example: '" + customDecoratorName + "(\"a.b.ClassName\", {overrides...})', file: " + config.fullPathName,
685685
errCode: 1
686686
}
687687
}
@@ -711,7 +711,7 @@ var es5_visitors = (function() {
711711
function _getParent(node, numberOfParents, config) {
712712
if (!node) {
713713
throw {
714-
message: "JSParser Error: No parent found for node in file: " + config.filePath,
714+
message: "JSParser Error: No parent found for node in file: " + config.fullPathName,
715715
errCode: 1
716716
}
717717
}

0 commit comments

Comments
 (0)