On Mon, Nov 22, 2010 at 5:20 PM, Ian Stevens wrote:
> On 2010-11-22, at 4:00 PM, Daryl Stultz wrote:
>
> So you can continue what you're doing (ie., init your Scriptable with
> functions to be accessed globally) but create scopes off your top-level
> scope (this) using Contex
On Mon, Nov 22, 2010 at 4:00 PM, Daryl Stultz wrote:
> doesn't have any effect which makes sense since I created "scope" based on
> "this". Perhaps my problem is really, how to expose global functions to the
> script. Can someone give me some examples of
> us
ps my problem is really, how to expose global functions to the
script. Can someone give me some examples of
using defineFunctionProperties()?
I do plenty of this:
ScriptableObject.putProperty(scope, "MyClass", new NativeJavaClass(scope,
blah.MyClass.class));
which puts the static m
ope"? I always use the same JavaScriptEvaluator instance for the entire
thread, so I guess that could mean I'm using the same scope for the whole
thread which is not my intention. It all seems pretty obvious now, but I'm
not really sure what to do, so tho
just text).
>
> There's been some discussion of supporting the "requires" function. That
might get you in the right direction.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6d
On Wed, May 26, 2010 at 5:59 PM, sk wrote:
> I keep getting: TypeError: [JavaPackage testpackage.Test] is not a
> function, it is object.
>
> Are you using a Class Shutter? I find I get this error for a class the
shutter doesn't permit.
--
Daryl Stultz
__
h similar to Dan's however I'd like to replace it with
"require". There's been some work done here to support the "require()"
function, I don't know much of the details, maybe someone else here can
cover it.
--
Daryl Stultz
__
at HttpClient.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com
___
dev-tech-js-engine-rhino mailing list
dev-tech-js-engine-rhino@lists.mozilla.org
https://lis
fter . operator"
>
I don't have any real help for you, but I'm reminded that the same error is
thrown (IIRC) on this:
myobject.delete()
I worked around it by renaming the function/method to remove(). Seems odd to
me that it chokes on this, but I don't
ry wrapFactory = *new* WrapFactory();
wrapFactory.setJavaPrimitiveWrap(*false*);
context.setWrapFactory(wrapFactory);
Sorry, I'm not sure if this will give you what you want or the opposite,
it's been a while...
--
Daryl Stultz
_
6 Degrees Software
from the terse
> Javadoc?
>
>
http://www.mozilla.org/rhino/tutorial.html
About half way down. Not really documentation, but that's where I got it...
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
t;
> how do I use it in Rhino?
>
> Well, this is how I use them, which may not be what you want since it puts
the values at the top level. Before running the script:
ScriptableObject.*putProperty*(scope, "CLUBS", Context.*javaToJS*(Cardsuit.*
CLUBS*, scope));
--
Daryl Stultz
On Tue, Jan 19, 2010 at 4:05 PM, Daryl Stultz wrote:
> Hello,
>
> I'm currently inserting text like this before compiling my script:
>
> "Bar = Packages." + foo.Bar.class.getName() + ";\n" + theScriptToRun
>
> as a way to "alias" the Bar
r" is not supported.
My ClassShutter allows access to foo.Bar. Anyone know what the problem is,
or how I can "import" classes into the top-level scope?
Thanks.
--Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:
On Mon, Jan 4, 2010 at 1:01 PM, Attila Szegedi wrote:
> On 2010.01.04., at 17:07, Daryl Stultz wrote:
> You can, of course... Then in turn, ...of course, you could ... then might
>
Wow, this is a bit deeper than I thought. Thanks for the details. What's
your opinion
tandard". How would someone writing
the JavaScript get tripped up by this?
Thanks.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com
___
dev-tech
On Mon, Jan 4, 2010 at 10:38 AM, Johan Compagner wrote:
> the thing is that JavaMembers could cache
Could it, should it, does it? Is this a feature/implementation request?
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.
another scope (the one
>> ClassCache was first associated with) - I'm not sure if this can cause any
>> problems (aside from never releasing that first scope from memory, which is
>> a minor, fixed size memory usage increase), it might actually work in your
>> scen
is too insignificant burden to the GC to justify keeping
> them around.
>
> They're simply too light to cache.
>
>
My concern was not memory use but the expense of method lookups via
reflection. I imagine Rhino does a lot of caching of the lookups, then?
--
Daryl Stultz
_
won't be changing my code down the line in
that regard.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com
___
dev-tech-js-engine-rhino mailing list
dev-
;weak
reference" which scares me, I'm likely to produce a memory issue. I'm
wondering if it would help performance or if the reflection lookup work is
already being cached. IOW, is caching at the WrapFactory worth the
performance improvement, if any?
Thank
roperty(scope, "Entity", yaddayadda);
but I don't know what to put in for yaddayadda to reference the class.
Anyone know?
Thanks.
--Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com
___
Hello,
Neither == nor === invokes equals() on my Java objects. Should I expect
either to return true? Obviously obj1.equals(obj2) works as expected. Sorry
my JavaScript is not so good. Is there some method I need to implement to
control how == works?
Thanks.
--
Daryl Stultz
On Wed, Dec 30, 2009 at 1:34 PM, Daryl Stultz wrote:
> Is there any way to automatically unwrap the object being added to the
> collection? Do I need to wrap all collections and implement add(), put(),
> etc. in order to unwrap it as it's being added?
>
> Between a WrapFa
, I believe I've found the solution to my problem.
I'll follow up on the other thread.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com
___
dev-tech-
On Wed, Dec 30, 2009 at 1:34 PM, Daryl Stultz wrote:
>
> domain.getChildren().add(new DomainEntity()); // fails because new object
is really a WrapperEntity (ok, it doesn't actually crash but it does add a
WrapperEntity to a List of .
I'm currently experimenting with WrapFactory
n? Do I need to wrap all collections and implement add(), put(),
etc. in order to unwrap it as it's being added?
Has anyone run into this?
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailt
between the Java
constructor and the JS constructor.
I'm currently exploring a path using a WrapFactory. If it doesn't pan out
I'll give your suggestion a try.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
ma
, Boolean or Scriptable instance. Please check your code for
missing Context.javaToJS() call.
Anyone know what I'm supposed to do? object1 and object2 are Foo classes, of
course, wrapped to be Scriptable.
Thanks.
--
Daryl Stultz
_
6 Degrees Software and Consu
On Tue, Dec 29, 2009 at 2:08 PM, Daryl Stultz wrote:
> That's similar to what I want to do. My host object would be generic with
> no properties, just the inner POJO delegate. A call to get/put would cause
> the host object to use reflection to access the appropriate getter/s
I'm not
sure how this could be done for a method/function though. Any ideas?
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com
___
dev-tech
On Tue, Dec 29, 2009 at 1:46 PM, Mark Storer wrote:
> On Tue, Dec 29, 2009 at 5:29 AM, Daryl Stultz wrote:
> > I do appreciate the annotations approach to writing host objects but it's
> > actually off topic from my original post.
>
> I disa
comes from the same object and I want it to come from the delegate.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com
___
dev-tech-js-engine-rhino mailing list
d
p the domain classes in a "JS API" class. The
wrapper would implement Scriptable and use annotations to determine if the
domain method being accessed (via scriptable.get("myMethod", start), for
example) should be allowed. While annotations would be
king for some feature of Rhino or JavaScript that might let
me more easily define what methods of the domain class are accessible. I'm
wondering if a host object has such features. Any input on how others are
handling this type of thing would be appreciated.
Thanks.
--
Daryl Stultz
___
JS e Object in
> following js script.
>
> But I don't understand this. Can you give more details of why you need it
and how you will use it once you get it.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.
?
can we get the e object ?
>
What does that mean? You printed the e object, didn't you?
> what is the type of e object ?
>
>
JS objects don't really have a type in the was Java objects do. Again, what
is your goal?
--
Daryl Stultz
_
6
rameters
to the function and have it modify the parameters, return new data, etc.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com
___
dev-tech-js-engine-r
a Java
application you want to expose to JavaScript, this probably isn't the
project for you. Maybe you should look for a different JavaScript
interpreter.
--
Daryl Stultz
_
6 Degrees Software and Consulting, Inc.
htt
On Mon, May 18, 2009 at 11:12 AM, Daryl Stultz wrote:
> Hey all, I've had some basic JS extensions to my application in place for
> some time now. It's time to get serious about building a proper API for my
> application.
In the event that my first post was too verbose (a
asses clearly illustrate
the classes and functions exposed to the JavaScript. Is there some way to
take advantage of Rhino/JavaScript, ScriptableObject, etc. to achieve my
goal? It seems like this design problem would be pretty common to anyone
designing a JavaScript AP
41 matches
Mail list logo