SitePen / dojo-amd-converter

A legacy dojo to AMD conversion utility.
Other
11 stars 5 forks source link

Add handler for dojo.exists #22

Open mmaxwell opened 11 years ago

mmaxwell commented 11 years ago

dojo.exists calls are not handled. In the trivial case, dojo.exists('foo', obj) can probably be converted to something like obj.foo != null (this might even be oversimplified given some of the magic used by dojo.exists). For more complex cases like dojo.exists('foo.bar', obj) or dojo.exists('global.foo') we probably need to just call lang.exists rather than unravel some of the magic.

francesmcmullin commented 11 years ago

Even for that trivial case we probably shouldn't assume obj is defined. What's wrong with always switching dojo.exists to lang.exists?