Provide a default assert implementation if one isn't passed in.

This commit is contained in:
joshaber
2016-04-26 16:14:25 -04:00
parent 44d3f2dd07
commit 46c97ee2b2

View File

@@ -101,8 +101,8 @@ class TextEditor extends Model
throw new Error("Must pass a config parameter when constructing TextEditors") unless @config?
throw new Error("Must pass a clipboard parameter when constructing TextEditors") unless @clipboard?
throw new Error("Must pass a grammarRegistry parameter when constructing TextEditors") unless @grammarRegistry?
throw new Error("Must pass an assert parameter when constructing TextEditors") unless @assert?
@assert ?= @defaultAssert.bind(this)
@firstVisibleScreenRow ?= 0
@firstVisibleScreenColumn ?= 0
@emitter = new Emitter
@@ -3365,6 +3365,9 @@ class TextEditor extends Model
@emitter.emit 'will-insert-text', willInsertEvent
result
defaultAssert: (condition, message, callback) ->
condition
###
Section: Language Mode Delegated Methods
###