Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JavaScript: capture the right side object of destructuring assignment…
… as anonymous class The JavaScript parser captures a variable, to which an object is assigned, with class kind. Input: var x = { prop: "value" }; Tags output (x.js): prop /tmp/x.js /^var x = { prop: "value" };$/;" p class:x x /tmp/x.js /^var x = { prop: "value" };$/;" c In a statement of destructuring assignment, there is no variable to which an object is assigned though an object exists at the right side. The JavaScript parser cannot provide the scope name when capturing a property in the object. That causes "null tag" warning. Input (y.js): var {prop} = { prop: "value" }; Tags output of the original JavaScript parser: ctags: Warning: ignoring null tag in /tmp/y.js(line: 1) prop /tmp/y.js /^var {prop} = { prop: "value" };$/;" p This change introduces an anonymous class to capture the right side object with class kind. Tags output of the JavaScript parser with this change: AnonymousClass322d0fb80101 /tmp/y.js /^var {prop} = { prop: "value" };$/;" c prop /tmp/y.js /^var {prop} = { prop: "value" };$/;" p class:AnonymousClass322d0fb80101 About destructuring binding, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment Signed-off-by: Masatake YAMATO <yamato@redhat.com>
- Loading branch information