X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FJSPrimitive.java;h=b4f3c9c8b538776751e0ceb7ef6b555ac2128d12;hb=a6fb49b55117ea4cf330b412d2a2fff403fcd053;hp=57f9c9ed076f8097233173af3b9bf39ed8a0356f;hpb=a1e6b7e9307319c0195b0efbe5e5354c128be481;p=org.ibex.js.git diff --git a/src/org/ibex/js/JSPrimitive.java b/src/org/ibex/js/JSPrimitive.java index 57f9c9e..b4f3c9c 100644 --- a/src/org/ibex/js/JSPrimitive.java +++ b/src/org/ibex/js/JSPrimitive.java @@ -4,21 +4,18 @@ package org.ibex.js; -class JSPrimitive extends JS.Immutable { +public 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;