ScopeChainForScopeDescriptor

This commit is contained in:
Ben Ogle
2014-10-15 15:11:41 -07:00
parent 593fc1e77a
commit d7d6e506da

View File

@@ -847,11 +847,7 @@ class Config
@emitter.emit 'did-change'
getRawScopedValue: (scopeDescriptor, keyPath) ->
scopeChain = scopeDescriptor
.map (scope) ->
scope = ".#{scope}" unless scope[0] is '.'
scope
.join(' ')
scopeChain = @scopeChainForScopeDescriptor(scopeDescriptor)
@scopedSettingsStore.getPropertyValue(scopeChain, keyPath)
observeScopedKeyPath: (scopeDescriptor, keyPath, callback) ->
@@ -886,6 +882,13 @@ class Config
.join(' ')
@scopedSettingsStore.getProperties(scopeChain, keyPath)
scopeChainForScopeDescriptor: (scopeDescriptor) ->
scopeDescriptor
.map (scope) ->
scope = ".#{scope}" unless scope[0] is '.'
scope
.join(' ')
# Base schema enforcers. These will coerce raw input into the specified type,
# and will throw an error when the value cannot be coerced. Throwing the error
# will indicate that the value should not be set.