Throw when editor dependencies are undefined

This commit is contained in:
Nathan Sobo
2015-10-03 08:28:22 -06:00
parent b729a9bb37
commit 95fbff033d

View File

@@ -90,6 +90,12 @@ class TextEditor extends Model
@viewRegistry, @project
} = params
throw new Error("Must pass a config parameter when constructing TextEditors") unless @config?
throw new Error("Must pass a notificationManager parameter when constructing TextEditors") unless @notificationManager?
throw new Error("Must pass a clipboard parameter when constructing TextEditors") unless @clipboard?
throw new Error("Must pass a viewRegistry parameter when constructing TextEditors") unless @viewRegistry?
throw new Error("Must pass a project parameter when constructing TextEditors") unless @project?
@emitter = new Emitter
@disposables = new CompositeDisposable
@cursors = []