SlexAxton/messageformat.js — pull request #36 by eemeli (2014-02-10 09:56:54+00:00)
Title: Add support for positional arguments

According to the [ICU MessageFormat spec](http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MessageFormat.html), arguments should be either named or positional. At the moment, messageformat.js only supports named arguments. To get positional variables to also work, all we need to do is allow for the argument id to start with a digit. Then you can pass in an array rather than an object to the compiled function, and it'll just work.

This is valid because the variables are internally handled as strings, and JavaScript's conversion between numbers and their string representations matches that of the spec, such that `[3,5]["1"] == { "0":3, "1":5 }["1"] == 5` while `typeof [3,5]["01"] == "undefined"`. See the included new tests for example usage.