Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Cleaner fix for LiveDevMultiBrowser infinite loop #10207

Merged
merged 3 commits into from
Dec 17, 2014

Conversation

peterflynn
Copy link
Member

This is for #10193. See discussion here for context: #10192 (comment).

Move shared code into FileUtils (with unit tests) to minimize diff in the _getInitialDocFromCurrent() code that is duplicated between the two Live Preview impls.

Also...

  • fixes an unhit edge case in getParentFolder() (now getParentDirectory()) that behaves differently across platforms
  • removes duplicate copy of getFilenameWithoutExtension() in LiveDevelopment.js (copy in FileUtils was identical)
  • add/fix some unit tests for two existing FileUtils APIs

Scott Wadden and others added 3 commits December 16, 2014 16:37
…ix-LiveDevMultiBrowser-loop

* commit 'bb4f4d0fdaae509cafd467364947717f0c70cb4d':
  LiveDevMultiBrowser should properly search parent directories for an index.html.
…iveDevelopment.js,

moving shared code to FileUtils with unit tests. Also...
- fixes an unhit edge case in getParentFolder() (now getParentDirectory())
that behaves differently across platforms
- removes duplicate copy of getFilenameWithoutExtension() in LiveDevelopment.js
(copy in FileUtils was identical)
- add/fix some unit tests for two existing FileUtils APIs
@@ -715,14 +705,14 @@ define(function LiveDevelopment(require, exports, module) {
}

var filteredFiltered = allFiles.filter(function (item) {
var parent = getParentFolder(item.fullPath);
var parent = FileUtils.getParentDirectory(item.fullPath);
Copy link
Contributor

Choose a reason for hiding this comment

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

i think getParentDirectoryPath is cleaner to indicate it returns a string (and analogous to getDirectoryPath).

@busykai
Copy link
Contributor

busykai commented Dec 17, 2014

LGTM, just the comment on the function name and nit on the suite name.

@busykai busykai self-assigned this Dec 17, 2014
@dsrw
Copy link
Contributor

dsrw commented Dec 17, 2014

Works for me. Thanks a lot @peterflynn and @busykai. I'll close my PR.

@peterflynn
Copy link
Member Author

@busykai Oops, sorry -- somehow I accidentally pushed a draft that didn't have my final changes committed. The actual changes in my real commit (should be up there now) doesn't have either of the issues you mentioned. (I used the API name getParentPath() to stay analogous with FleSystemEntry.parentPath, as well as to indicate a string return value as you mentioned).

@busykai
Copy link
Contributor

busykai commented Dec 17, 2014

@peterflynn, thanks! This looks good to me. Just some manual testing and will merge it. The tests are clean.

@peterflynn
Copy link
Member Author

Excellent, thanks!

@busykai
Copy link
Contributor

busykai commented Dec 17, 2014

Merging.

busykai added a commit that referenced this pull request Dec 17, 2014
Cleaner fix for LiveDevMultiBrowser infinite loop
@busykai busykai merged commit 3143d38 into release Dec 17, 2014
@pthiess pthiess removed the Ready label Dec 17, 2014
@busykai busykai deleted the pflynn/fix-LiveDevMultiBrowser-loop branch December 17, 2014 19:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants