mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03:00
Allow null keyPath with options argument in ::get
This commit is contained in:
parent
d30cf35a16
commit
f859ad5fc5
@ -47,6 +47,8 @@ describe "Config", ->
|
|||||||
# Schema defaults never match a specific source. We could potentially add a special "schema" source.
|
# Schema defaults never match a specific source. We could potentially add a special "schema" source.
|
||||||
expect(atom.config.get("x.y", sources: ["x"], scope: [".foo"])).toBeUndefined()
|
expect(atom.config.get("x.y", sources: ["x"], scope: [".foo"])).toBeUndefined()
|
||||||
|
|
||||||
|
expect(atom.config.get(null, sources: ['a'], scope: [".foo"]).x.y).toBe 1
|
||||||
|
|
||||||
describe "when an 'excludeSources' option is specified", ->
|
describe "when an 'excludeSources' option is specified", ->
|
||||||
it "only retrieves values from the specified sources", ->
|
it "only retrieves values from the specified sources", ->
|
||||||
atom.config.set("x.y", 1, scopeSelector: ".foo", source: "a")
|
atom.config.set("x.y", 1, scopeSelector: ".foo", source: "a")
|
||||||
|
@ -457,7 +457,7 @@ class Config
|
|||||||
# file in the type specified by the configuration schema.
|
# file in the type specified by the configuration schema.
|
||||||
get: ->
|
get: ->
|
||||||
if arguments.length > 1
|
if arguments.length > 1
|
||||||
if typeof arguments[0] is 'string'
|
if typeof arguments[0] is 'string' or not arguments[0]?
|
||||||
keyPath = arguments[0]
|
keyPath = arguments[0]
|
||||||
options = arguments[1]
|
options = arguments[1]
|
||||||
{scope} = options
|
{scope} = options
|
||||||
|
Loading…
Reference in New Issue
Block a user