Revision: 4401 http://vexi.svn.sourceforge.net/vexi/?rev=4401&view=rev Author: clrg Date: 2012-06-01 19:24:14 +0000 (Fri, 01 Jun 2012) Log Message: ----------- Add vexi.js.copy()
Modified Paths: -------------- trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSU.java Modified: trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSU.java =================================================================== --- trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSU.java 2012-06-01 17:18:44 UTC (rev 4400) +++ trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSU.java 2012-06-01 19:24:14 UTC (rev 4401) @@ -17,15 +17,23 @@ } } - - public static JS deepcopy(JS obj) throws JSExn{ - if(obj==null) return obj; + public static JS deepcopy(JS obj) throws JSExn { + if (obj==null) return obj; else if(obj instanceof JS.Copyable){ return ((JS.Copyable)obj).deepcopy(); - }else{ + } else { throw new JSExn("deepcopy not supported for: "+obj.getClass().getName()); } } + public static JS copy(JS obj) throws JSExn { + if (obj==null) return obj; + else if(obj instanceof JS.Copyable){ + return ((JS.Copyable)obj).copy(); + } else { + throw new JSExn("deepcopy not supported for: "+obj.getClass().getName()); + } + } + //////////////////// // CLONE stuff This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn