Skip to content

combineUrl fix #2400

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

Merged
merged 1 commit into from
Nov 24, 2012
Merged

combineUrl fix #2400

merged 1 commit into from
Nov 24, 2012

Conversation

khodzha
Copy link
Contributor

@khodzha khodzha commented Nov 23, 2012

Trying to resolve #2279

@@ -85,6 +85,8 @@ function assert(cond, msg) {
// Combines two URLs. The baseUrl shall be absolute URL. If the url is an
// absolute URL, it will be returned as is.
function combineUrl(baseUrl, url) {
if (url == "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather see a url.length == 0 or !url check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why you prefer them over url==""?

@yurydelendik
Copy link
Contributor

Really good. In this case if (!url)will be a better choice since the main problem with #2279 is "url.indexOf is not a function" (for empty string the indexOf will be a function). Notice that the issue is about url equal null, empty string or undefined. The !url will capture all of those cases.

Address the comments below and squash the commits into one (see https://github.com/mozilla/pdf.js/wiki/Squashing-Commits)

@@ -85,6 +85,8 @@ function assert(cond, msg) {
// Combines two URLs. The baseUrl shall be absolute URL. If the url is an
// absolute URL, it will be returned as is.
function combineUrl(baseUrl, url) {
if (url.length == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change that to if (!url)

@yurydelendik
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @yurydelendik received. Current queue size: 0

Live output at: http://107.22.172.223:8877/3b9b9d812e63a31/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @yurydelendik received. Current queue size: 0

Live output at: http://107.21.233.14:8877/b45b450d2c6f8f3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/3b9b9d812e63a31/output.txt

Total script time: 14.32 mins

  • Lint: Passed
  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/b45b450d2c6f8f3/output.txt

Total script time: 14.38 mins

  • Lint: Passed
  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.21.233.14:8877/b45b450d2c6f8f3/reftest-analyzer.xhtml#web=eq.log

yurydelendik added a commit that referenced this pull request Nov 24, 2012
@yurydelendik yurydelendik merged commit 80f8f51 into mozilla:master Nov 24, 2012
@yurydelendik
Copy link
Contributor

looks good. thank you for the patch

@khodzha
Copy link
Contributor Author

khodzha commented Nov 24, 2012

regression tests failed? doesn't look good

@yurydelendik
Copy link
Contributor

that's an intermittent failure

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.

url.indexOf is not a function
4 participants