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

[READY] tldjs gives inconsistent results #35

Merged
merged 5 commits into from
Jan 17, 2014
Merged

[READY] tldjs gives inconsistent results #35

merged 5 commits into from
Jan 17, 2014

Conversation

thom4parisot
Copy link
Owner

Consider the following test case:

$ node
> var tld = require('tldjs');
> tld.getSubdomain('www.majestic12.co.uk');
'www'
> tld.getSubdomain('www.bl.uk');
'www'
> tld.getSubdomain('www.majestic12.co.uk');
'www.majestic12'

Notice the first and the third run, where getSubdomain() is given the exact same input.

Expectation: Same result from tld.getSubdomain(), when the function is given same input.

Actual: Different result from tld.getSubdomain(), dependent on what other domains have been parsed in the mean time between the two calls.

@thom4parisot
Copy link
Owner

Definitely a bug which should not happen.

I wonder if it's due to the lazy loading rule mechanism in place. I'll investigate that unless you coin out the problem within the sourcecode.

@thom4parisot
Copy link
Owner

For the moment, I've just written the tests unveiling the problem. I'll investigate it on Friday.

thom4parisot pushed a commit that referenced this pull request Jan 17, 2014
[WIP] tldjs gives inconsistent results
@thom4parisot thom4parisot merged commit 1b9e1b4 into master Jan 17, 2014
@thom4parisot thom4parisot deleted the fix-35 branch January 17, 2014 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant