Skip to content

Commit

Permalink
[INTERNAL] jsdoc/plugin.js: Fix consistency check
Browse files Browse the repository at this point in the history
Override the access value after logging the error message;
otherwise, the error log would contain the overridden value.

Change-Id: Ie309ad1b10fb21fefa799ba0d866576f0f079f71
  • Loading branch information
devtomtom committed Jun 21, 2024
1 parent 5cb8255 commit 4884168
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/jsdoc/ui5/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1157,17 +1157,17 @@ function collectVisibilityInfo(settings, doclet, className, n) {

if (visibility === 'hidden' && (access === 'public' || access === 'protected' || access === 'restricted')) {
// force access to private to avoid inconsistencies in libraries that ignore JSDoc errors
access = "private";
error(`${className}: Inconsistent visibility settings detected. Runtime metadata sets visibility to '${visibility}', while JSDoc defines it as '${access}' for the managed setting '${n}'. Forcing visibility to 'hidden'.`);
access = "private";
}
if (visibility === 'public' && access === 'private') {
// force access to 'restricted' to avoid inconsistencies in libraries that ignore JSDoc errors
access = "restricted";
ui5data(doclet).stakeholders ??= [];
if ( !doclet.__ui5.stakeholders.includes(className) ) {
doclet.__ui5.stakeholders.push(className);
}
error(`${className}: Inconsistent visibility settings detected. Runtime metadata sets visibility to '${visibility}', while JSDoc defines it as '${access}' for the managed setting '${n}'. Forcing visibility to 'restricted'.`);
access = "restricted";
}

if (visibility == "public" && (access === "restricted" || access === "protected")) {
Expand Down

0 comments on commit 4884168

Please sign in to comment.