Skip to content

Commit

Permalink
Make getObject("", false, obj) return obj rather than undefined.
Browse files Browse the repository at this point in the history
Matches 1.9 behavior and fixes many dojox/mvc/tests failures.
Refs #16291.
  • Loading branch information
asudoh authored and wkeese committed May 21, 2014
1 parent f41414d commit 2957d1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _base/lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ define(["./kernel", "../has", "../sniff"], function(dojo, has){
// context: Object?
// Optional. Object to use as root of path. Defaults to
// 'dojo.global'. Null may be passed.
return getProp(name.split("."), create, context); // Object
return getProp(name ? name.split(".") : [], create, context); // Object
},

exists: function(name, obj){
Expand Down
4 changes: 4 additions & 0 deletions tests/_base/lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ define(["doh/main", "dojo/_base/array", "dojo/_base/lang", "dojo/_base/kernel"

// strangely, parser does this
t.assertEqual("undefined", typeof lang.getObject("./TestWidget"), 'typeof lang.getObject("./TestWidget")');

// empty path should return the same object
t.assertEqual(test, lang.getObject("", false, test));
t.assertEqual(kernel.global, lang.getObject(""));
},

function setObject(t){
Expand Down

0 comments on commit 2957d1b

Please sign in to comment.