# HG changeset patch # User Matthew Wild # Date 1290393236 0 # Node ID 1555cb5a97b3e84ae501ad83171ad065251f38f9 # Parent 82d7b057d330eea4a7afaffed25b4c29e38f0ac0 Switch to [] for representing tables (for now) diff -r 82d7b057d330 -r 1555cb5a97b3 lvm.js --- 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); })