Revision: 3716 http://vexi.svn.sourceforge.net/vexi/?rev=3716&view=rev Author: mkpg2 Date: 2009-10-21 17:39:30 +0000 (Wed, 21 Oct 2009)
Log Message: ----------- Small changes. - deepcopy() fails only if there are read traps - cleanup Modified Paths: -------------- trunk/core/org.ibex.js/src/org/ibex/js/Interpreter.jpp trunk/core/org.ibex.js/src/org/ibex/js/JS.jpp trunk/core/org.vexi.core/src/org/vexi/core/Blessing.java trunk/core/org.vexi.core/src_junit/test/core/util.t Modified: trunk/core/org.ibex.js/src/org/ibex/js/Interpreter.jpp =================================================================== --- trunk/core/org.ibex.js/src/org/ibex/js/Interpreter.jpp 2009-10-21 17:20:43 UTC (rev 3715) +++ trunk/core/org.ibex.js/src/org/ibex/js/Interpreter.jpp 2009-10-21 17:39:30 UTC (rev 3716) @@ -406,15 +406,9 @@ if (key == null) throw je("Tried to get the null key from " + JSU.toString(target)); if (target == null) throw je("Tried to get property \"" + JSU.toString(key) + "\" from the null object"); - JS.Trap t = null; - t = target.getTrap(key); + JS.Trap t = target.getTrap(key); if (t != null) t = t.findRead(); - - if(t == null && target instanceof JS.Clone) { - t = ((JS.Clone)target).clonee.getTrap(key); - if (t != null) t = t.nextRead(); - } - + if(t != null) { JS f = t.function(); if(f instanceof JSFunction){ Modified: trunk/core/org.ibex.js/src/org/ibex/js/JS.jpp =================================================================== --- trunk/core/org.ibex.js/src/org/ibex/js/JS.jpp 2009-10-21 17:20:43 UTC (rev 3715) +++ trunk/core/org.ibex.js/src/org/ibex/js/JS.jpp 2009-10-21 17:39:30 UTC (rev 3716) @@ -486,7 +486,13 @@ throw new JSExn("deepcopy not supported for: "+getClass().getName()); } if (traps!=null && traps.size()>0) { - throw new JSExn("cannot deepcopy object with traps"); + Iterator I = traps.keySet().iterator(); + while(I.hasNext()){ + JS key = (JS)I.next(); + Trap t = (Trap) traps.get(key); + if(t.findRead()!=null) + throw new JSExn("cannot deepcopy object with read traps: "+JSU.toString(key)); + } } JS.Obj r = new JS.Obj(); Enumeration E = keys().iterator(); Modified: trunk/core/org.vexi.core/src/org/vexi/core/Blessing.java =================================================================== --- trunk/core/org.vexi.core/src/org/vexi/core/Blessing.java 2009-10-21 17:20:43 UTC (rev 3715) +++ trunk/core/org.vexi.core/src/org/vexi/core/Blessing.java 2009-10-21 17:39:30 UTC (rev 3716) @@ -63,7 +63,7 @@ return ret; } } - // REMARK - calling getAndTriggerTraps in a plain get? + // HACK - calling getAndTriggerTraps in a plain get JS ret = new Blessing(Main.SCHEDULER.getAndTriggerTraps(clonee, key), vexi, this, key); cache.put(key, ret); return ret; Modified: trunk/core/org.vexi.core/src_junit/test/core/util.t =================================================================== --- trunk/core/org.vexi.core/src_junit/test/core/util.t 2009-10-21 17:20:43 UTC (rev 3715) +++ trunk/core/org.vexi.core/src_junit/test/core/util.t 2009-10-21 17:39:30 UTC (rev 3716) @@ -29,5 +29,14 @@ } } + static.assertThrowsExn = function(f){ + try{ + f(); + }catch(e){ + return; + } + throw "Expected exception"; + }; + <ui:box/> </vexi> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn