Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsdoc issue #183

Closed
thomaswormann opened this issue Aug 28, 2023 · 2 comments
Closed

jsdoc issue #183

thomaswormann opened this issue Aug 28, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@thomaswormann
Copy link

thomaswormann commented Aug 28, 2023

Hi Chris,

I think you forgot to update your jsdoc on one of your latest changes here:

/**
* Add an attribute to an element
* @param {Node} elem The element
* @param {String} att The attribute
* @param {String} val The value
* @param {Boolean} events If true, inline events are allowed
*/
function addAttribute (elem, att, val, events) {

In the jsdoc you reference events as a boolean, later your accessing it as a object:

if (events && events.delegate) {
events.delegate(elem, att, val);
return;
}

And I think the problem starts at the diffAttribute function, where events is declared as a boolean as well:

/**
* Compare the existing node attributes to the template node attributes and make updates
* @param {Node} template The new template
* @param {Node} existing The existing DOM node
* @param {Boolean} events If true, inline events allowed
*/
function diffAttributes (template, existing, events) {

And no jsdoc regarding events here at all:

/**
* Add default attributes to a newly created element
* @param {Node} elem The element
*/
function addDefaultAtts (elem, events) {

Cheers,
Thomas

@cferdinandi
Copy link
Owner

Good catch, thanks! I'll get that updated soon...

@cferdinandi cferdinandi added the bug Something isn't working label Oct 7, 2023
@cferdinandi
Copy link
Owner

This was fixed at some point. I forget which version, though, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants