davisp/jiffy — pull request #53 by yjh0502 (2014-02-02 16:05:28+00:00)
Title: Add erlang map support

Erlang map type #{key => value} is introduced on R17!

I added support to decode json into erlang map type. Here's some notes.
- It's fully backward compatible. All existing tests compiles & passes.
- jiffy:decode/2 is exported, second options argument which accepts [map] to enable json to erlang map decoding.
- If erlang map type is available (checked by ERL_NIF_MAJOR_VERSION and ERL_NIF_MINOR_VERSION) and [map] option is passed, it decodes javascript object into erlang map.
- Erlang map is first transalated into ejson object format[1] and then translated into json. All well-tested codes are reused in conversion code path.
- Some shell scripts are introduced in Makefile to check erlang version. I couldn't find an easy way to check if erlang map is supported, so I used some dirty shell scripts.
- I tried to add etap test code, but there is no straight-forward way to add tests conditionally because of hard-coded etap:plan.

[1] {[{key1, val1}, {key2, val2}]}