Re: CommonJS Modules in Rhino

2010-03-06 Thread Martin Blom
On 12/02/2010 23:02, Attila Szegedi wrote: Hi again, Sorry for taking so long. I've started playing with the patch in the context of my ESXX project and while I haven't had time to finish yet I have a couple of questions: 1) I already have a path array in ESXX, which also happens to be a JS

Re: CommonJS Modules in Rhino

2010-02-19 Thread Hannes Wallnoefer
Sorry Attila, I forgot I still owe you an answer... On Feb 3, 6:39 pm, Attila Szegedi wrote: > On 2010.02.03., at 17:52, Hannes Wallnoefer wrote: > > > Other than that, I really like your implementation. Helma NG does a > > few things differently, so it's not likely we'll replace our > > implemen

Re: CommonJS Modules in Rhino

2010-02-15 Thread Attila Szegedi
Folks, Given that the current implementation state seems sufficiently stable, I committed it to CVS HEAD and will continue development there. The committed version features following changes compared to last patch: - Require constructor can now accept a pre-exec and a post-exec Script; these a

Re: CommonJS Modules in Rhino

2010-02-12 Thread Attila Szegedi
On 2010.02.10., at 22:28, Martin Blom wrote: > On 31/01/2010 20:15, Attila Szegedi wrote: >> Hi all, >> >> I just put out the second implementation patch >> at, against current CVS >> HEAD. Check it out if you're interested. I have worked on

Re: CommonJS Modules in Rhino

2010-02-10 Thread Attila Szegedi
On 2010.02.10., at 19:38, Jarosław Pałka wrote: > Attila, > > I applied third version of your patch. I have two comments: > - I don't see where you execute interoperablejs tests, I see them in source > code but it looks like they are not run as part of junit-all target Maybe I > missed somethi

Re: CommonJS Modules in Rhino

2010-02-10 Thread Attila Szegedi
Yeah, returning null in ScriptProviders and ScriptSourceProviders allows them to be composed and fall back on each other without exceptions being thrown and caught. It's only when it'd surface as nonexistent from require() that the error is thrown. Attila. On 2010.02.10., at 20:12, Jarosław Pa

Re: CommonJS Modules in Rhino

2010-02-10 Thread Martin Blom
Martin Blom skrev 2010-02-10 22.28: 1) I already have a path array in ESXX, which also happens to be a JS array that is searched from the front. However, having two path objects is weired, so I'm wondering if we could either perhaps replace the 'secure' argument with a 'paths' argument (Scriptab

Re: CommonJS Modules in Rhino

2010-02-10 Thread Martin Blom
On 31/01/2010 20:15, Attila Szegedi wrote: Hi all, I just put out the second implementation patch at, against current CVS HEAD. Check it out if you're interested. I have worked on this for I most of my free time I can have for coding in the

Re: CommonJS Modules in Rhino

2010-02-10 Thread Jarosław Pałka
Ok, you throw exception in Require :), in getModule() :) nice trick Jarosław Pałka pisze: Attila, I applied third version of your patch. I have two comments: - I don't see where you execute interoperablejs tests, I see them in source code but it looks like they are not run as part of junit-all

Re: CommonJS Modules in Rhino

2010-02-10 Thread Jarosław Pałka
Attila, I applied third version of your patch. I have two comments: - I don't see where you execute interoperablejs tests, I see them in source code but it looks like they are not run as part of junit-all target Maybe I missed something :( - In CachingModuleScriptProviderBase, in line 70, you r

Re: CommonJS Modules in Rhino

2010-02-10 Thread Jarosław Pałka
No problem :) I was busy last few days with my daily work, in this case I will check your patch and put comments. In the meantime, I thought about integrating modules with ScriptableObject. What I mean by that? Currently in patch we have a nice way to load modules from JavaScript files.I think it

Re: CommonJS Modules in Rhino

2010-02-10 Thread Attila Szegedi
Actually, I was informed on the commonjs list that there's a new set of compliance tests at and the one on interoperablejs is obsolete. Also, just this morning i put out a new patch at

Re: CommonJS Modules in Rhino

2010-02-10 Thread Jarosław Pałka
Ok, I will include it in my patch, Jarek W dniu 8 lutego 2010 10:52 użytkownik Attila Szegedi napisał: > I don't have a problem with depending on external SVN repo. It's unlikely > that a googlecode SVN will go anywhere. The Rhino build already pulls > libraries from Maven repositories. I act

Re: CommonJS Modules in Rhino

2010-02-08 Thread Attila Szegedi
I don't have a problem with depending on external SVN repo. It's unlikely that a googlecode SVN will go anywhere. The Rhino build already pulls libraries from Maven repositories. I actually started by adding: http://interoperablejs.googlecode.com/svn/trunk/"/>

Re: CommonJS Modules in Rhino

2010-02-08 Thread Jarosław Pałka
Before I prepare my patch we need to decide where to put interoperablejs. I don't think that having dependencies to external SVN repo is a good solution. I think the best way is to simply commit content of http://interoperablejs.googlecode.com/svn/trunk into mozilla/js/rhino/testsrc/interoperablejs

Re: CommonJS Modules in Rhino

2010-02-07 Thread Attila Szegedi
Hi yes, please. I did start working on a JUnit driver for them myself, but if you already have it completed, I'll be happy to accept your patch and save me some work. Thanks, Attila. On 2010.02.08., at 8:57, Jarosław Pałka wrote: > Attila, > > I have finished tests with interoperablejs. I

Re: CommonJS Modules in Rhino

2010-02-07 Thread Jarosław Pałka
Attila, I have finished tests with interoperablejs. I wonder how should I share it with you. Should I attach tests suite to bugzilla issue? Jarek W dniu 8 lutego 2010 08:14 użytkownik Attila Szegedi napisał: > On 2010.02.07., at 20:33, Jarosław Pałka wrote: > > > Attila, > > > > I was playing w

Re: CommonJS Modules in Rhino

2010-02-07 Thread Attila Szegedi
On 2010.02.07., at 20:33, Jarosław Pałka wrote: > Attila, > > I was playing with your patch for few days, and one thing I found is annoying > NullPointerException when module is not found :), I believe we should have > more meaningful exception message. > > I am also working on tests, using ht

Re: CommonJS Modules in Rhino

2010-02-07 Thread Jarosław Pałka
Attila, I was playing with your patch for few days, and one thing I found is annoying NullPointerException when module is not found :), I believe we should have more meaningful exception message. I am also working on tests, using http://code.google.com/p/interoperablejs/. Were you trying to run y

Re: CommonJS Modules in Rhino

2010-02-03 Thread Chris Zumbrunn
On Wed, Feb 3, 2010 at 18:39, Attila Szegedi wrote: > On 2010.02.03., at 17:52, Hannes Wallnoefer wrote: > >> The only >> problem I had is the similarity between ModuleSource and ModuleScript >> and related interfaces and classes. *ModuleSourceProvider and >> *ModuleScriptProvder just look very si

Re: CommonJS Modules in Rhino

2010-02-03 Thread Attila Szegedi
On 2010.02.03., at 17:52, Hannes Wallnoefer wrote: > On Jan 31, 8:15 pm, Attila Szegedi wrote: >> Hi all, >> >> I just put out the second implementation patch at >> , against current CVS >> HEAD. Check it out if you're interested. I have wor

Re: CommonJS Modules in Rhino

2010-02-03 Thread Hannes Wallnoefer
On Jan 31, 8:15 pm, Attila Szegedi wrote: > Hi all, > > I just put out the second implementation patch at > , against current CVS > HEAD. Check it out if you're interested. I have worked on this for I most of > my free time I can have for cod

Re: CommonJS Modules in Rhino

2010-01-31 Thread Attila Szegedi
Hi all, I just put out the second implementation patch at , against current CVS HEAD. Check it out if you're interested. I have worked on this for I most of my free time I can have for coding in the last 12 days, and have arrived at a much b

Re: CommonJS Modules in Rhino

2010-01-19 Thread Attila Szegedi
Hi, I created a Bugzilla issue to track this work: I already attached a patch with the implementation to the above issue, so feel free to check it out and provide feedback. I believe that the JavaDocs I provided are sufficiently comprehensiv

Re: CommonJS Modules in Rhino

2010-01-18 Thread Nathan
On Jan 18, 10:51 am, Attila Szegedi wrote: > Yes, absolutely - I would create an interface: > > public interface ModuleScriptProvider > { >     public Script getModuleScript(Context cx, String scriptId); > > } > > and the embedding code would be responsible for providing an implementation > of it

Re: CommonJS Modules in Rhino

2010-01-18 Thread Attila Szegedi
Yes, absolutely - I would create an interface: public interface ModuleScriptProvider { public Script getModuleScript(Context cx, String scriptId); } and the embedding code would be responsible for providing an implementation of it. Attila. On 2010.01.18., at 17:49, Martin Blom wrote: > On

Re: CommonJS Modules in Rhino

2010-01-18 Thread Michael Mathews
+1 This would be useful to me as well, possibly for future releases of JsDoc Toolkit. Michael Mathews On 18/01/2010, Mark Porter wrote: > On Jan 17, 11:35 am, Attila Szegedi wrote: > >> I'm contemplating adding CommonJS Modules implementation to Rhino codebase >> proper. >> ... >> Attila.

Re: CommonJS Modules in Rhino

2010-01-18 Thread Martin Blom
On 01/17/10 07:35 PM, Attila Szegedi wrote: Folks, I'm contemplating adding CommonJS Modules implementation to Rhino codebase proper. I'd create org.mozilla.javascript.commonjs package to hold it, and we could have a method similar to initStandardObjects(), i.e. initCommonJs() that'd initiali

Re: CommonJS Modules in Rhino

2010-01-18 Thread Mark Porter
On Jan 17, 11:35 am, Attila Szegedi wrote: > I'm contemplating adding CommonJS Modules implementation to Rhino codebase > proper. > ... > Attila. +1 Sounds fantastic. Instant basic CommonJS support for all Rhino users. I have been using Narwhal, which is fantastic, but this would be a much mo

Re: CommonJS Modules in Rhino

2010-01-18 Thread Jarosław Pałka
Count me in as well. Jarek 2010/1/18 Rapha > I like the idea. Are you thinking of the 1.1 spec ( > http://wiki.commonjs.org/wiki/Modules/1.1 ) ? > > Raphael > > On Jan 17, 1:35 pm, Attila Szegedi wrote: > > Folks, > > > > I'm contemplating adding CommonJS Modules implementation to Rhino > code

Re: CommonJS Modules in Rhino

2010-01-18 Thread Rapha
I like the idea. Are you thinking of the 1.1 spec ( http://wiki.commonjs.org/wiki/Modules/1.1 ) ? Raphael On Jan 17, 1:35 pm, Attila Szegedi wrote: > Folks, > > I'm contemplating adding CommonJS Modules implementation to Rhino codebase > proper. I'd create org.mozilla.javascript.commonjs packag