From 95fbff033dc47c6fb3b31dfeeb155c1f7233c7f7 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 3 Oct 2015 08:28:22 -0600 Subject: [PATCH] Throw when editor dependencies are undefined --- src/text-editor.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index aa9cb6fea..921cc26c1 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -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 = []