Revision: 2193 http://vexi.svn.sourceforge.net/vexi/?rev=2193&view=rev Author: mkpg2 Date: 2007-09-14 05:49:31 -0700 (Fri, 14 Sep 2007)
Log Message: ----------- Fix. Function missing messages. Modified Paths: -------------- trunk/core/org.ibex.js/src/org/ibex/js/Interpreter.jpp trunk/core/org.ibex.js/src/org/ibex/js/JSArray.jpp trunk/core/org.ibex.js/src_junit/test/js/exec/shared.js Added Paths: ----------- trunk/core/org.ibex.js/src_junit/test/js/exec/general/funcmissing.js Modified: trunk/core/org.ibex.js/src/org/ibex/js/Interpreter.jpp =================================================================== --- trunk/core/org.ibex.js/src/org/ibex/js/Interpreter.jpp 2007-09-14 12:25:42 UTC (rev 2192) +++ trunk/core/org.ibex.js/src/org/ibex/js/Interpreter.jpp 2007-09-14 12:49:31 UTC (rev 2193) @@ -362,6 +362,8 @@ if (object == null) { method = (JS)stack.pop(); object = (JS)stack.pop(); + if (object instanceof JSPrimitive) + throw new JSExn("method '"+JSU.toString(method)+"' not defined for " + object.type()); throw new JSExn("function '"+JSU.toString(method)+"' not found in " + JSU.toString(object)); } else if (object == JS.METHOD) { method = (JS)stack.pop(); Modified: trunk/core/org.ibex.js/src/org/ibex/js/JSArray.jpp =================================================================== --- trunk/core/org.ibex.js/src/org/ibex/js/JSArray.jpp 2007-09-14 12:25:42 UTC (rev 2192) +++ trunk/core/org.ibex.js/src/org/ibex/js/JSArray.jpp 2007-09-14 12:49:31 UTC (rev 2193) @@ -54,6 +54,8 @@ case "toString": return METHOD; case "unshift": return METHOD; //#end + // better? + // return null; throw new JSExn("arrays only support positive integer keys, can not use: "+JSU.toString(key)); } int i = JSU.toInt(key); Added: trunk/core/org.ibex.js/src_junit/test/js/exec/general/funcmissing.js =================================================================== --- trunk/core/org.ibex.js/src_junit/test/js/exec/general/funcmissing.js (rev 0) +++ trunk/core/org.ibex.js/src_junit/test/js/exec/general/funcmissing.js 2007-09-14 12:49:31 UTC (rev 2193) @@ -0,0 +1,23 @@ +sys.import("shared"); + +try{"foobar".blah();}catch(e){ + sys.log.info(e.message); + var x = e.message.split("for"); + assertEquals(" string" ,x[1]); +} + + +try{(5).blah();}catch(e){ + sys.log.info(e.message); + var x = e.message.split("for"); + assertEquals(" number" ,x[1]); +} + +try{[].blah();}catch(e){ + sys.log.info(e.message); +} + + +try{({}).blah();}catch(e){ + sys.log.info(e.message); +} \ No newline at end of file Modified: trunk/core/org.ibex.js/src_junit/test/js/exec/shared.js =================================================================== --- trunk/core/org.ibex.js/src_junit/test/js/exec/shared.js 2007-09-14 12:25:42 UTC (rev 2192) +++ trunk/core/org.ibex.js/src_junit/test/js/exec/shared.js 2007-09-14 12:49:31 UTC (rev 2193) @@ -8,10 +8,16 @@ export.assertEquals = function(a,b){ if(a==b) return; - throw "Expected equals: " + a + " != " + b; + throw "Expected equals: '" + a + "' != '" + b + "'"; //assert(false); }; +export.assertNotEquals = function(a,b){ + if(a!=b) + return; + throw "Expected not equals: '" + a + "' == '" + b + "'"; + //assert(false); +}; export.strToArray = function(str){ var r = []; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn