From ae38bda49e6a8953a1443aab777c98d18adb5328 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 11 Jan 2005 08:12:20 +0000 Subject: [PATCH] fix JSPrimitive bug that broke methods on JSStrings darcs-hash:20050111081220-5007d-ec2ad0cb4a739a1175e93c86b902e7e2a6c54950.gz --- src/org/ibex/js/JSPrimitive.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/org/ibex/js/JSPrimitive.java b/src/org/ibex/js/JSPrimitive.java index 57f9c9e..e011453 100644 --- a/src/org/ibex/js/JSPrimitive.java +++ b/src/org/ibex/js/JSPrimitive.java @@ -7,18 +7,15 @@ package org.ibex.js; class JSPrimitive extends JS.Immutable { private static final JS.Method METHOD = new JS.Method(); - public JS callMethod(JS method, JS[] args) throws JSExn { + public JS call(JS method, JS[] args) throws JSExn { + String s = coerceToString(); + int slength = s.length(); + //#switch(JSU.str(method)) case "toFixed": throw new JSExn("toFixed() not implemented"); case "toExponential": throw new JSExn("toExponential() not implemented"); case "toPrecision": throw new JSExn("toPrecision() not implemented"); case "toString": return this instanceof JSString ? this : JSU.S(JSU.toString(this)); - //#end - - String s = coerceToString(); - int slength = s.length(); - - //#switch(JSU.toString(method)) case "substring": { int a = args.length >= 1 ? JSU.toInt(args[0]) : 0; int b = args.length >= 2 ? JSU.toInt(args[1]) : slength; -- 1.7.10.4