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

Bug in getting embedded source contents #199

Merged
merged 1 commit into from
Aug 4, 2015

Conversation

fitzgen
Copy link
Contributor

@fitzgen fitzgen commented Jul 29, 2015

This is just a failing test case right now. Haven't dug into it yet.

See also https://bugzilla.mozilla.org/show_bug.cgi?id=1188697

@fitzgen
Copy link
Contributor Author

fitzgen commented Jul 29, 2015

Ok, figured this out. We rely on maintaining the invariant that sources are internally stored relative to the source root (except when the source is absolute and the source root is not) and there is a case where we weren't maintaining this: when the source is absolute and the source root is a prefix of the source. Why would a tool do that? No idea. Probably not on purpose.

r? @jryans

@fitzgen
Copy link
Contributor Author

fitzgen commented Jul 29, 2015

Oops jryans is on pto. I just chose him because he had dealt with source root issues before but it doesn't need his review in particular.

r? @ejpbruel

@fitzgen
Copy link
Contributor Author

fitzgen commented Jul 31, 2015

Everyone is on PTO...

r? @tromey

// be particularly problematic when the source root is a prefix of the
// source (valid, but why??). See github issue #199 and bugzil.la/1188982.
.map(function (source) {
return sourceRoot && sourceRoot.charAt(0) === '/' && source.charAt(0) === '/'
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought most sourceRoots were URLs, not simple local paths? Do we need a better check for "is absolute" to cover those too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got halfway through writing a comment about why I didn't think so, but then unconvinced myself and finally realized that we should just add test coverage for more edge cases here...

@fitzgen
Copy link
Contributor Author

fitzgen commented Aug 4, 2015

Ok added the test for URLs too.

r? @jryans

@@ -185,6 +185,10 @@ define(function (require, exports, module) {
}
exports.join = join;

exports.isAbsolute = function (aPath) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should normalize use this new utility instead of having it own similar check?

@jryans
Copy link
Contributor

jryans commented Aug 4, 2015

r+, looks good overall!

fitzgen added a commit that referenced this pull request Aug 4, 2015
Bug in getting embedded source contents
@fitzgen fitzgen merged commit 7b22120 into mozilla:master Aug 4, 2015
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.

2 participants