diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 911eaccc9..20d9fde3f 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -20,7 +20,7 @@ describe "Editor", -> cachedLineHeight beforeEach -> - rootView = new RootView(pathToOpen: require.resolve('fixtures/sample.js')) + rootView = new RootView(require.resolve('fixtures/sample.js')) project = rootView.project editor = rootView.activeEditor() buffer = editor.buffer diff --git a/spec/app/root-view-spec.coffee b/spec/app/root-view-spec.coffee index 6d8d4d5e7..46cd37506 100644 --- a/spec/app/root-view-spec.coffee +++ b/spec/app/root-view-spec.coffee @@ -11,7 +11,7 @@ describe "RootView", -> beforeEach -> path = require.resolve 'fixtures/dir/a' - rootView = new RootView(pathToOpen: path) + rootView = new RootView(path) rootView.enableKeymap() rootView.focus() project = rootView.project @@ -30,7 +30,7 @@ describe "RootView", -> describe "when pathToOpen references a directory", -> it "creates a project for the directory and sets the document.title, but does not open an editor", -> path = require.resolve 'fixtures/dir' - rootView = new RootView(pathToOpen: path) + rootView = new RootView(path) rootView.focus() expect(rootView.project.getPath()).toBe path @@ -113,7 +113,7 @@ describe "RootView", -> describe "focus", -> it "can receive focus if there is no active editor, but otherwise hands off focus to the active editor", -> - rootView = new RootView(pathToOpen: require.resolve 'fixtures') + rootView = new RootView(require.resolve 'fixtures') rootView.attachToDom() expect(rootView).toMatchSelector(':focus') diff --git a/spec/app/status-bar-spec.coffee b/spec/app/status-bar-spec.coffee index 310cda50a..21a42a1d9 100644 --- a/spec/app/status-bar-spec.coffee +++ b/spec/app/status-bar-spec.coffee @@ -6,7 +6,7 @@ describe "StatusBar", -> [rootView, editor, statusBar] = [] beforeEach -> - rootView = new RootView(pathToOpen: require.resolve('fixtures/sample.js')) + rootView = new RootView(require.resolve('fixtures/sample.js')) rootView.simulateDomAttachment() StatusBar.activate(rootView) editor = rootView.activeEditor() diff --git a/spec/extensions/autocomplete-spec.coffee b/spec/extensions/autocomplete-spec.coffee index d062a5ca2..85d2a1824 100644 --- a/spec/extensions/autocomplete-spec.coffee +++ b/spec/extensions/autocomplete-spec.coffee @@ -17,7 +17,7 @@ describe "Autocomplete", -> describe "@activate(rootView)", -> it "activates autocomplete on all existing and future editors (but not on autocomplete's own mini editor)", -> - rootView = new RootView(pathToOpen: require.resolve('fixtures/sample.js')) + rootView = new RootView(require.resolve('fixtures/sample.js')) rootView.simulateDomAttachment() Autocomplete.activate(rootView) leftEditor = rootView.activeEditor() diff --git a/spec/extensions/file-finder-spec.coffee b/spec/extensions/file-finder-spec.coffee index cd418c8c0..3073267ba 100644 --- a/spec/extensions/file-finder-spec.coffee +++ b/spec/extensions/file-finder-spec.coffee @@ -7,7 +7,7 @@ describe 'FileFinder', -> [rootView, finder] = [] beforeEach -> - rootView = new RootView(pathToOpen: require.resolve('fixtures/sample.js')) + rootView = new RootView(require.resolve('fixtures/sample.js')) rootView.enableKeymap() rootView.activateExtension(FileFinder) finder = FileFinder.instance diff --git a/spec/extensions/tree-view-spec.coffee b/spec/extensions/tree-view-spec.coffee index 9be064a7f..c058643f7 100644 --- a/spec/extensions/tree-view-spec.coffee +++ b/spec/extensions/tree-view-spec.coffee @@ -10,7 +10,7 @@ describe "TreeView", -> [rootView, project, treeView, sampleJs, sampleTxt] = [] beforeEach -> - rootView = new RootView(pathToOpen: require.resolve('fixtures/')) + rootView = new RootView(require.resolve('fixtures/')) project = rootView.project rootView.activateExtension(TreeView) @@ -421,7 +421,7 @@ describe "TreeView", -> fs.makeDirectory(dirPath) fs.write(filePath, "doesn't matter") - rootView = new RootView(pathToOpen: rootDirPath) + rootView = new RootView(rootDirPath) project = rootView.project treeView = new TreeView(rootView) treeView.root = treeView.root diff --git a/src/app/cursor.coffee b/src/app/cursor.coffee index 408efc0cb..6bfcef620 100644 --- a/src/app/cursor.coffee +++ b/src/app/cursor.coffee @@ -13,7 +13,7 @@ class Cursor extends View editor: null wordRegex: /(\w+)|([^\w\s]+)/g - initialize: ({editor, screenPosition}) -> + initialize: ({editor, screenPosition} = {}) -> @editor = editor @anchor = new Anchor(@editor, screenPosition) @selection = @editor.compositeSelection.addSelectionForCursor(this) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 73c8a3dc2..20f9d7c04 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -24,7 +24,7 @@ class Editor extends View @div class: 'vertical-scrollbar', outlet: 'verticalScrollbar', => @div outlet: 'verticalScrollbarContent' - @classes: ({mini}) -> + @classes: ({mini} = {}) -> classes = ['editor'] classes.push 'mini' if mini classes.join(' ') @@ -57,7 +57,7 @@ class Editor extends View new Editor(viewState) - initialize: ({editSessions, activeEditSessionIndex, buffer, isFocused, @mini}) -> + initialize: ({editSessions, activeEditSessionIndex, buffer, isFocused, @mini} = {}) -> requireStylesheet 'editor.css' requireStylesheet 'theme/twilight.css' diff --git a/src/app/root-view.coffee b/src/app/root-view.coffee index 522b8f7a8..0109e3391 100644 --- a/src/app/root-view.coffee +++ b/src/app/root-view.coffee @@ -21,7 +21,7 @@ class RootView extends View @div id: 'panes', outlet: 'panes' @deserialize: ({ projectPath, panesViewState, extensionStates }) -> - rootView = new RootView(pathToOpen: projectPath) + rootView = new RootView(projectPath) rootView.setRootPane(rootView.deserializeView(panesViewState)) if panesViewState rootView.extensionStates = extensionStates if extensionStates rootView @@ -30,7 +30,7 @@ class RootView extends View extensionStates: null fontSize: 18 - initialize: ({ pathToOpen }) -> + initialize: (pathToOpen) -> @extensions = {} @extensionStates = {} @project = new Project(pathToOpen) diff --git a/src/app/selection.coffee b/src/app/selection.coffee index 474f53ca6..f734ef680 100644 --- a/src/app/selection.coffee +++ b/src/app/selection.coffee @@ -14,7 +14,7 @@ class Selection extends View retainSelection: null regions: null - initialize: ({@editor, @cursor}) -> + initialize: ({@editor, @cursor} = {}) -> @regions = [] handleBufferChange: (e) -> diff --git a/src/app/window.coffee b/src/app/window.coffee index e75c4c2c8..5b6209d1d 100644 --- a/src/app/window.coffee +++ b/src/app/window.coffee @@ -42,7 +42,7 @@ windowAdditions = if rootViewState @rootView = RootView.deserialize(rootViewState) else - @rootView = new RootView(pathToOpen: pathToOpen) + @rootView = new RootView(pathToOpen) @rootView.open() unless pathToOpen $(@rootViewParentSelector).append @rootView diff --git a/src/extensions/tree-view/dialog.coffee b/src/extensions/tree-view/dialog.coffee index c04140cb5..07cb328c3 100644 --- a/src/extensions/tree-view/dialog.coffee +++ b/src/extensions/tree-view/dialog.coffee @@ -5,12 +5,12 @@ $ = require 'jquery' module.exports = class Dialog extends View - @content: ({prompt}) -> + @content: ({prompt} = {}) -> @div class: 'tree-view-dialog', => @div prompt, outlet: 'prompt' @subview 'miniEditor', new Editor(mini: true) - initialize: ({path, @onConfirm, select}) -> + initialize: ({path, @onConfirm, select} = {}) -> @miniEditor.focus() @on 'tree-view:confirm', => @confirm() @on 'tree-view:cancel', => @cancel() diff --git a/src/extensions/tree-view/directory-view.coffee b/src/extensions/tree-view/directory-view.coffee index 9f0d330be..72fec53b1 100644 --- a/src/extensions/tree-view/directory-view.coffee +++ b/src/extensions/tree-view/directory-view.coffee @@ -5,7 +5,7 @@ $ = require 'jquery' module.exports = class DirectoryView extends View - @content: ({directory, isExpanded}) -> + @content: ({directory, isExpanded} = {}) -> @li class: 'directory entry', => @div outlet: 'header', class: 'header', => @span '▸', class: 'disclosure-arrow', outlet: 'disclosureArrow' @@ -15,7 +15,7 @@ class DirectoryView extends View entries: null header: null - initialize: ({@directory, isExpanded}) -> + initialize: ({@directory, isExpanded} = {}) -> @expand() if isExpanded @disclosureArrow.on 'click', => @toggleExpansion()