From 68bbc228d96c94c90d08b088f7499300f4d86477 Mon Sep 17 00:00:00 2001 From: Brett Langdon Date: Mon, 22 Apr 2013 20:09:48 -0400 Subject: [PATCH] fix #5: passing tables as function parameters --- package.json | 2 +- src/utils.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fc51df9..95de1d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodelua", - "version": "0.2.1", + "version": "0.2.2", "description": "Lua Bindings For Node.JS", "keywords": [ "lua" diff --git a/src/utils.cc b/src/utils.cc index 3c561d5..20fc036 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -29,7 +29,7 @@ v8::Local lua_to_value(lua_State* L, int i){ { v8::Local obj = v8::Object::New(); lua_pushnil(L); - while(lua_next(L, i-1) != 0){ + while(lua_next(L, -2) != 0){ v8::Local key = lua_to_value(L, -2); v8::Local value = lua_to_value(L, -1); obj->Set(key, value);