Subj : Re: Rhino: Evaluating E4X expression causes syntax error To : netscape.public.mozilla.jseng From : rituraj.tiwari Date : Fri Jun 24 2005 02:30 pm Nevermind, found it. I was setting an incorrect JavaScript version on my context. -Raj rituraj.tiwari@gmail.com wrote: > I am trying to run an E4X expression from the sample. My code doe sthe > following: > > - Creates an Javascript fragment: > String sExpression = "var order = > ; > - Enters a context: > Context cx = enterContext( scope ); > - Attempts to evaluate the code fragment: > result = cx.evaluateString( internal, sExpression, > id.getName(), id.getLine(), id ); > > This is resulting a syntax error: > org.mozilla.javascript.EvaluatorException: syntax error > > With the following info: > var order = > ..............^ > > Partial stack trace is: > at org.mozilla.javascript.Parser.addError(Parser.java:120)^M > at org.mozilla.javascript.Parser.reportError(Parser.java:126)^M > at org.mozilla.javascript.Parser.primaryExpr(Parser.java:2009)^M > at org.mozilla.javascript.Parser.memberExpr(Parser.java:1637)^M > at org.mozilla.javascript.Parser.unaryExpr(Parser.java:1500)^M > at org.mozilla.javascript.Parser.mulExpr(Parser.java:1429)^M > at org.mozilla.javascript.Parser.addExpr(Parser.java:1410)^M > at org.mozilla.javascript.Parser.shiftExpr(Parser.java:1390)^M > at org.mozilla.javascript.Parser.relExpr(Parser.java:1364)^M > at org.mozilla.javascript.Parser.eqExpr(Parser.java:1320)^M > at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:1309)^M > at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:1298)^M > at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:1287)^M > at org.mozilla.javascript.Parser.andExpr(Parser.java:1275)^M > at org.mozilla.javascript.Parser.orExpr(Parser.java:1263)^M > at org.mozilla.javascript.Parser.condExpr(Parser.java:1246)^M > at org.mozilla.javascript.Parser.assignExpr(Parser.java:1228)^M > at org.mozilla.javascript.Parser.variables(Parser.java:1204)^M > at > org.mozilla.javascript.Parser.statementHelper(Parser.java:1015)^M > at org.mozilla.javascript.Parser.statement(Parser.java:616)^M > at org.mozilla.javascript.Parser.parse(Parser.java:347)^M > at org.mozilla.javascript.Parser.parse(Parser.java:287)^M > at org.mozilla.javascript.Context.compileImpl(Context.java:2384)^M > at > org.mozilla.javascript.Context.compileString(Context.java:1372)^M > at > org.mozilla.javascript.Context.compileString(Context.java:1361)^M > at > org.mozilla.javascript.Context.evaluateString(Context.java:1217)^M > > > I am using Rhino 1.6 R1. Any idea what could be going on here? > > Thanks. > -Raj .