Fix specs

This commit is contained in:
Ben Ogle
2014-10-20 18:40:32 -07:00
parent 3a70b98ae1
commit 14c8e9cedc
2 changed files with 3 additions and 2 deletions

View File

@@ -352,7 +352,7 @@ class Config
if args.length is 2
# observe(keyPath, callback)
[keyPath, callback, scopeDescriptor, options] = args
else if args.length is 3 and Array.isArray(scopeDescriptor)
else if args.length is 3 and (Array.isArray(scopeDescriptor) or scopeDescriptor instanceof ScopeDescriptor)
# observe(scopeDescriptor, keyPath, callback)
[scopeDescriptor, keyPath, callback, options] = args
else if args.length is 3 and _.isString(scopeDescriptor) and _.isObject(keyPath)

View File

@@ -6,6 +6,7 @@ EmitterMixin = require('emissary').Emitter
Serializable = require 'serializable'
TokenizedLine = require './tokenized-line'
Token = require './token'
ScopeDescriptor = require './scope-descriptor'
Grim = require 'grim'
module.exports =
@@ -303,7 +304,7 @@ class TokenizedBuffer extends Model
0
scopeDescriptorForPosition: (position) ->
new ScopeDescriptor descriptor: @tokenForPosition(position).scopeDescriptor
new ScopeDescriptor(descriptor: @tokenForPosition(position).scopeDescriptor)
tokenForPosition: (position) ->
{row, column} = Point.fromObject(position)