1

I have noticed that in dojo source code there are two ways people are creating their nls files. It's about the use of parentheses.

https://github.com/dojo/dojo/blob/master/nls/colors.js:

define({ 
    root: ({
        aliceblue: "alice blue",
        antiquewhite: "antique white",
        (..)
    })
})

https://github.com/dojo/dojo/blob/master/tests/nls/salutations.js:

define({ 
    root: {
        ar: "Arabic",
        cs: "Czech",
        (..)
    }
})

Both are parsed correctly and it seems that dojo doesn't care if and how many additional parentheses there is (as long as the number of closing parentheses matches the number of opening parentheses).

The same way additional parentheses can be added to the define block.

Is there anything gained by enclosing the root value in parentheses?

Michal Fotyga
  • 91
  • 1
  • 4

0 Answers0