comparison src/luan/impl/LuanImpl.java @ 1330:f41919741100

fix security
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 11 Feb 2019 01:38:55 -0700
parents 9fa8b8389578
children 25746915a241
comparison
equal deleted inserted replaced
1329:5a39b006acd1 1330:f41919741100
160 if( t instanceof LuanTable ) { 160 if( t instanceof LuanTable ) {
161 LuanTable tbl = (LuanTable)t; 161 LuanTable tbl = (LuanTable)t;
162 tbl.put(key,value); 162 tbl.put(key,value);
163 return; 163 return;
164 } 164 }
165 if( t != null && luan.javaOk.ok ) 165 if( t != null && luan.peek().javaOk )
166 JavaLuan.__new_index(luan,t,key,value); 166 JavaLuan.__new_index(luan,t,key,value);
167 else 167 else
168 throw new LuanException( "attempt to index a " + Luan.type(t) + " value" ); 168 throw new LuanException( "attempt to index a " + Luan.type(t) + " value" );
169 } 169 }
170 170
227 return rtn; 227 return rtn;
228 } 228 }
229 } 229 }
230 } 230 }
231 231
232 public static LuanTable table(LuanState luan,Object[] a) { 232 public static LuanTable table(LuanState luan,Object[] a) throws LuanException {
233 LuanTable table = new LuanTable(luan); 233 LuanTable table = new LuanTable(luan);
234 int i = 0; 234 int i = 0;
235 for( Object fld : a ) { 235 for( Object fld : a ) {
236 if( fld instanceof TableField ) { 236 if( fld instanceof TableField ) {
237 TableField tblFld = (TableField)fld; 237 TableField tblFld = (TableField)fld;