# HG changeset patch # User jbe # Date 1406771697 -7200 # Node ID ddb9b9b0d210a5e4c2f8d2c4412596683a4447ba # Parent d42a7a84035886ef379ed73590d6511679d1b1ce Removed json.isnull function from JSON library (use json.type(...) == "null" instead) diff -r d42a7a840358 -r ddb9b9b0d210 libraries/json/json.c --- a/libraries/json/json.c Thu Jul 31 03:49:43 2014 +0200 +++ b/libraries/json/json.c Thu Jul 31 03:54:57 2014 +0200 @@ -545,21 +545,6 @@ return json_path(L, 1); } -// checks if a value in a JSON document (first argument) is -// explicitly set to null: -static int json_isnull(lua_State *L) { - const char *jsontype; - // call json_type function with variable arguments: - lua_pushcfunction(L, json_type); - lua_insert(L, 1); - lua_call(L, lua_gettop(L) - 1, 1); - // return true if result equals to string "null", otherwise return false: - jsontype = lua_tostring(L, -1); - if (jsontype && !strcmp(jsontype, "null")) lua_pushboolean(L, 1); - else lua_pushboolean(L, 0); - return 1; -} - // returns the length of a JSON array (or zero for a table without numeric keys): static int json_len(lua_State *L) { // stack shall contain one function argument: @@ -832,7 +817,6 @@ {"export", json_export}, {"get", json_get}, {"type", json_type}, - {"isnull", json_isnull}, {NULL, NULL} };