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

Method substr is undefined (fix) #77

Closed
wants to merge 1 commit into from
Closed

Method substr is undefined (fix) #77

wants to merge 1 commit into from

Conversation

dan-on
Copy link

@dan-on dan-on commented Jan 20, 2018

Hello!

The current build of your project, returns an error: "Uncaught TypeError: (a || "").substr is not a function"

@hgoebl
Copy link
Owner

hgoebl commented Jan 20, 2018

It's a bit more complicated.
I suppose you get the error because the user-agent string is not string, but undefined, null or something else. substr is not a new function and it should be available to string instances even in very old browsers.
The semantics between substr and substring is not equal. So even if this pull request was merged, it would probably break, at least one of the changes.

Where do you get the error message?

@dan-on
Copy link
Author

dan-on commented Jan 20, 2018

You're right! I accidentally passed an object to the constructor.

Excuse me. Thank for the quick answer.

@dan-on dan-on closed this Jan 20, 2018
@hgoebl
Copy link
Owner

hgoebl commented Jan 20, 2018

No problem, at least I've learned the subtle difference between both functions :-)

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

Successfully merging this pull request may close these issues.

None yet

2 participants