jakarta-bsf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Bukanov <i...@fastmail.fm>
Subject Re: cvs commit: jakarta-bsf/src/org/apache/bsf/engines/javascript JavaScriptEngine.java
Date Wed, 04 Aug 2004 17:47:10 GMT
Adam R. B. Jack wrote:
> Thanks for doing this. Do you mind explaining if this was an issue 
> within BSF, or a change within Rhino? Just curious (to see if things 
> will break on users in the field w/ mixed environments.)

This was caused by a change in Rhino. The public function BSF uses is 
already restored in Rhino CVS. Moreover, I would suggest to revert BSF 
change since ScriptRuntime.call does proper error reporting if fun is 
not org.mozilla.javascript.Function instance. And while reverting that I 
also suggest to replace:

retval = ScriptRuntime.call(cx, fun, global, args, null);
by
retval = ScriptRuntime.call(cx, fun, global, args,
             ScriptRuntime.emptyArgs);

since it is not OK (and never was!) to pass null to Rhino function to 
indicate empty argument array.

Regards, Igor

> 
> regards
> 
> Adam
> -- 
> Have you Gump'ed your code today?
> http://gump.apache.org
> 
> On Wed, 4 Aug 2004 orlikowski@apache.org wrote:
> 
>> orlikowski    2004/08/04 05:12:33
>>
>>  Modified:    src/org/apache/bsf/engines/javascript JavaScriptEngine.java
>>  Log:
>>  Fix up a build break that Gump reported.
>>
>>  Revision  Changes    Path
>>  1.10      +4 -3      
>> jakarta-bsf/src/org/apache/bsf/engines/javascript/JavaScriptEngine.java
>>
>>  Index: JavaScriptEngine.java
>>  ===================================================================
>>  RCS file: 
>> /home/cvs/jakarta-bsf/src/org/apache/bsf/engines/javascript/JavaScriptEngine.java,v

>>
>>  retrieving revision 1.9
>>  retrieving revision 1.10
>>  diff -u -r1.9 -r1.10
>>  --- JavaScriptEngine.java    14 Jun 2004 17:29:40 -0000    1.9
>>  +++ JavaScriptEngine.java    4 Aug 2004 12:12:32 -0000    1.10
>>  @@ -63,12 +63,12 @@
>>   import org.mozilla.javascript.ClassDefinitionException;
>>   import org.mozilla.javascript.Context;
>>   import org.mozilla.javascript.EvaluatorException;
>>  +import org.mozilla.javascript.Function;
>>   import org.mozilla.javascript.JavaScriptException;
>>   import org.mozilla.javascript.PropertyException;
>>   import org.mozilla.javascript.NativeJavaObject;
>>   import org.mozilla.javascript.Scriptable;
>>   import org.mozilla.javascript.ScriptableObject;
>>  -import org.mozilla.javascript.ScriptRuntime;
>>   import org.mozilla.javascript.WrappedException;
>>   import org.mozilla.javascript.Wrapper;
>>   import org.mozilla.javascript.ImporterTopLevel;
>>  @@ -126,8 +126,9 @@
>>               cx.setGeneratingSource(false);
>>               cx.setOptimizationLevel(0);
>>               cx.setDebugger(null, null);
>>  -
>>  -            retval = ScriptRuntime.call(cx, fun, global, args, null);
>>  +
>>  +            Function function = (Function) fun;
>>  +            retval = function.call(cx, null, global, args);
>>
>>               if (retval instanceof Wrapper)
>>                   retval = ((Wrapper) retval).unwrap();
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: bsf-dev-help@jakarta.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bsf-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


Mime
View raw message