cferdinandi / reef

A lightweight library for creating reactive, state-based components and UI.

Home Page:https://reefjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsdoc issue

thomaswormann opened this issue · comments

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

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

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