Shift the args before coercing the value

This commit is contained in:
Ben Ogle
2014-10-01 16:44:26 -07:00
parent 778d9fafc5
commit 7a5054027e

View File

@@ -394,17 +394,17 @@ class Config
# * `true` if the value was set.
# * `false` if the value was not able to be coerced to the type specified in the setting's schema.
set: (scope, keyPath, value) ->
if arguments.length < 3
value = keyPath
keyPath = scope
scope = undefined
unless value == undefined
try
value = @makeValueConformToSchema(keyPath, value)
catch e
return false
if arguments.length < 3
value = keyPath
keyPath = scope
scope = undefined
if scope?
@addRawScopedValue(scope, keyPath, value)
else