Mon, 22 Nov 2010 02:33:56 +0000
Switch to [] for representing tables (for now)
lvm.js | file | annotate | diff | comparison | revisions |
--- a/lvm.js Mon Nov 22 02:32:01 2010 +0000 +++ b/lvm.js Mon Nov 22 02:33:56 2010 +0000 @@ -459,7 +459,7 @@ frame.reg[INS_A(instruction)] = new LValue(this, constant.type, constant.value); break; case OP_NEWTABLE: - frame.reg[INS_A(instruction)] = new LValue(this, "table", {}); + frame.reg[INS_A(instruction)] = new LValue(this, "table", []); break; case OP_GETTABLE: var C = INS_C(instruction); @@ -696,7 +696,7 @@ var t; if(name) { - t = this.LValue({}); // Create env[name] and put fns in there + t = this.LValue([]); // Create env[name] and put fns in there env.setIndex(this.LValue(name), t); } else @@ -714,7 +714,7 @@ var sys=require("sys"); var c = new LBinaryChunk(testvm, fs.readFileSync("luac.out", "binary")); -var _G = testvm.LValue({}); +var _G = testvm.LValue([]); // Standard library @@ -827,7 +827,7 @@ testvm.registerLib(_G, "string", string); // Metatable on environment to print out nil global accesses -var mt = testvm.LValue({}); +var mt = testvm.LValue([]); mt.setIndex( testvm.LValue("__index"), testvm.LValue(function (t, k) { sys.puts("Access of nil global: "+k); })