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

Not searching for null value for elementClassName in prototypejs 1.7 #329

Open
Nabarun opened this issue May 1, 2017 · 0 comments
Open

Comments

@Nabarun
Copy link

Nabarun commented May 1, 2017

In prototypejs 1.5 we were verifying for null value which we are not doing in 1.7

Current 1.7 version has the following

hasClassName: function(element, className) {
if (!(element = $(element))) return;
var elementClassName = element.className;
return (elementClassName.length > 0 && (elementClassName == className ||
new RegExp("(^|\s)" + className + "(\s|$)").test(elementClassName)));
},

In 1.5 we were having the following

hasClassName: function(element, className) {
if (!(element = $(element))) return;
var elementClassName = element.className;
if (elementClassName == null || elementClassName.length == 0) return false;
if (elementClassName == className ||
elementClassName.match(new RegExp("(^|\s)" + className + "(\s|$)")))
return true;
return false;
},

Because of this issue one of my existing feature was breaking. I solved the issue by adding
if(typeof elementClassName === "undefined") return false;
to 1.7 version

Let me know if this is intended or can be considered as bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant