mherkender/lua.js — pull request #31 by elisee (2013-05-04 13:40:31+00:00)
Title: Fix string.* functions to coerce number into string like Lua does

Lua uses luaL_checklstring on arguments in string.* functions to ensure they are strings or numbers and coerce numbers into strings.

This pull request introduces a check_string() function that does the same and uses it for supported string.* functions.

For instance, this allows running `string.len( 456 )` and get back 3, like the original Lua allows.