r24034 - in /trunk/libjavascript-perl: Changes JavaScript.xs MANIFEST META.yml PJS_Context.c PJS_Context.h debian/changelog dev_tests/ lib/JavaScript.pm lib/JavaScript/Context.pm lib/JavaScript/Runtime.pm lib/Test/JavaScript/More.pm t/31-version.t typemap

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sat Aug 9 23:32:10 UTC 2008


Author: gregoa
Date: Sat Aug  9 23:32:08 2008
New Revision: 24034

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=24034
Log:
New upstream release.

Added:
    trunk/libjavascript-perl/dev_tests/
      - copied from r24033, branches/upstream/libjavascript-perl/current/dev_tests/
    trunk/libjavascript-perl/t/31-version.t
      - copied unchanged from r24033, branches/upstream/libjavascript-perl/current/t/31-version.t
Modified:
    trunk/libjavascript-perl/Changes
    trunk/libjavascript-perl/JavaScript.xs
    trunk/libjavascript-perl/MANIFEST
    trunk/libjavascript-perl/META.yml
    trunk/libjavascript-perl/PJS_Context.c
    trunk/libjavascript-perl/PJS_Context.h
    trunk/libjavascript-perl/debian/changelog
    trunk/libjavascript-perl/lib/JavaScript.pm
    trunk/libjavascript-perl/lib/JavaScript/Context.pm
    trunk/libjavascript-perl/lib/JavaScript/Runtime.pm
    trunk/libjavascript-perl/lib/Test/JavaScript/More.pm
    trunk/libjavascript-perl/typemap

Modified: trunk/libjavascript-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/Changes?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/Changes (original)
+++ trunk/libjavascript-perl/Changes Sat Aug  9 23:32:08 2008
@@ -1,10 +1,17 @@
 Revision history for Perl extension JavaScript.
 
-1.08 Thu May 8 2008
+1.09  2008-08-03
+    - It's now possible to set and get the version of JS our context is dealing with since in
+      some cases such as using 'let' and 'yield' we actually have to specify that we want
+      1.7 features.
+    - Fix a bunch of small pod issues. [rt.cpan.org #30333]
+    - Fix Changes (this file) to use ISO 8601 dates
+    
+1.08  2008-05-08
     - Fixes Makefile.PL issues which made it fail on various platforms when trying to compile test app.
     - Added option to skip building of test app. Set environment variable JS_FORCE to a true value.
     
-1.07 Tue May 6 2008
+1.07  2008-05-06
     - Makefile.PL should abort with exit code 0 if conditions are not met instead of exit code 1.
     - Don't increase refcount for object originating from Perl (James Duncan).
     - Make bind_value croak if trying to rebind an already existing property.
@@ -13,13 +20,13 @@
     - Fix longtime memory leak caused by decreasing refcount on RV instead of on the 
       SV the RV references. [rt.cpan.org #35571]
     
-1.06 Fri Apr 18 2008
+1.06  2008-04-18
     - Objects returned when creating constructor for bound classes should not increment
       refcount because this causes the objects to never be freed (James Duncan)
     - Docs stated argument constructor could be omitted in bind_class which wasn't the case and 
       so now it can and a default constructor will be created.
       
-1.05 Tue Apr 1 2008
+1.05  2008-04-01
     - Drop support for error handlers
     - This module now requires SpiderMonkey 1.7 or later.
     - Makefile.PL now compiles a small test to see if libs and headers can be found
@@ -27,7 +34,7 @@
     - Drop support for Perl 5.6.x and earlier because we need some API symbols not available there 
       and they don't support unicode properly either. [rt.cpan.org #31114]
       
-1.04 Sat Nov 17 2007
+1.04  2007-11-17
     - Skip exception tests on engines less than 1.7 since these seem to be broken.
     - Free memory allocated by JS_smprintf when converting from utf8 strings (spotted by Ash Berlin)
     - Don't call js_ValueToXMLString but instead call JS method "toXMLString" on the object [rt.cpan.org #26411]
@@ -45,7 +52,7 @@
     - Split up giant .XS file into smaller pieces
     - Added CREDITS to MANIFEST so it's bundled with the distribution
     
-1.03 Wed Feb 21 2007
+1.03  2007-02-21
     - Honor value of JS_ENABLE_E4X
     - Improved README
     - Added CREDITS
@@ -64,27 +71,27 @@
     - Allow building with debug symbols (set JS_DEBUG to a true value) (Fotango)
     - Allow setting JS_THREADSAFE and JS_UTF8 to true/false to avoid the prompts (Fotango)
 
-1.02 Mon Feb 12 2007
+1.02  2007-02-17
     - Makefile.PL now generates a JavaScript_Env.h that sets correct defines and includes correct headers
     - Structs, macros etc are now in a JavaScript.h
     - Header files and typemap is now installed with module
     - Added ext field (void *) to PJS_Runtime and PJS_Context that can be used custom stuff
             
-1.01 Mon Feb 12 2007
+1.01  2007-02-12
     - Added support for detecting DarwinPorts [rt.cpan.org #14910]
     - Added missing test for converting JavaScript booleans -> Perl
     - Integrated patch that fixes compilation problems on Debian (Toru Yamaguchi, Daniel Burke)
     - Cleaned up TODO
 
-1.00 Mon Sep 4 2006
+1.00  2006-09-04
     - Release of 1.00
 
-1.00_02 Sat Aug 19 2006
+1.00_02  2006-08-19
     - Incorporated patch to support new SpiderMokey installation-scheme in Debian [rt.cpan.org #18152]
     - Passing ERRSV to SVToJSVAL doesn't seem to be safe so we'll pass a copy instead (Tom Insam)
     - Cleaning up some internal function names
 
-1.00_01 Tue Jul 11 2006
+1.00_01  2006-07-11
     - Fixed invocation of methods on objects
     - Added support for "static" methods of classes, i.e. "Test.foo(...)" should now work
     - Added support for "static" properties of classes, i.e. "Test.bar = 10"; should now work
@@ -101,13 +108,13 @@
         - Lots or more tests
         - And lots more
 
-0.55 Wed Jun 30 9:05:00 CET 2005
+0.55  2005-06-30
     - Fixed error handling (patch by G. Allen Morris III)
 
-0.54 Tue Jun 29 11:50:00 CET 2005
+0.54  2005-06-29
     - Make Makefile.PL play happy games with Gentoo (patch by sungo)
 
-0.53 Fri Mar 18 19:49:25 CET 2005 (Joost Diepenmaat)
+0.53  2005-03-18
     - Added JS_THREADSAFE define, which fixed bug on perl 5.8.5
       thread-multi linux
     - added tests for debian spidermonkey libs (debian users can
@@ -119,20 +126,20 @@
       to run on perl 5.8.6 threaded and unthreaded)
     - Fixed a couple of alloc()s
     
-0.52 Sat Aug 11 22:47:00 2001
+0.52  2001-08-11
     - Added can method to JavaScript::Context
     - Removed the need of passing the JSClass name to bind_object
     - Fixed issues with package
     - Fixed return from call
     - Brought docs up to sync with implementation
 
-0.51 Thu Jul 26 12:01:00 2001
+0.51  2001-07-26
     - Changed new_context to create_context to match documentation
     - Changed create_context to not try and take named arguments
 
-0.5 Wed Jul 25 14:20:10 2001
+0.5   2001-06-25
     - First public release
     
-0.01 Mon Mar 19 09:51:10 2001
+0.01  2001-03-19
     - original version; created by h2xs 1.21 with options
         -f -n JavaScript

Modified: trunk/libjavascript-perl/JavaScript.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/JavaScript.xs?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/JavaScript.xs (original)
+++ trunk/libjavascript-perl/JavaScript.xs Sat Aug  9 23:32:08 2008
@@ -3,6 +3,10 @@
 #include "XSUB.h"
 
 #include "JavaScript.h"
+
+#ifndef FUN_OBJECT(fun)
+#define FUN_OBJECT(fun) (jsval)(fun->object)
+#endif
 
 MODULE = JavaScript     PACKAGE = JavaScript
 PROTOTYPES: DISABLE
@@ -119,6 +123,21 @@
     OUTPUT:
         RETVAL
 
+const char *
+jsc_get_version(cx)
+    PJS_Context *cx;
+    CODE:
+        RETVAL = JS_VersionToString(JS_GetVersion(PJS_GetJSContext(cx)));
+    OUTPUT:
+        RETVAL
+
+void
+jsc_set_version(cx, version)
+    PJS_Context *cx;
+    const char *version;
+    CODE:
+        JS_SetVersion(PJS_GetJSContext(cx), JS_StringToVersion(version));
+        
 void
 jsc_set_branch_handler(cx, handler)
     PJS_Context *cx;
@@ -294,7 +313,7 @@
             tmp = SvIV((SV*)SvRV(PJS_call_perl_method("content", function, NULL)));
             func = INT2PTR(JSFunction *, tmp);
 
-            if (PJS_call_javascript_function(cx, (jsval) (func->object), args, &rval) == JS_FALSE) {
+            if (PJS_call_javascript_function(cx, FUN_OBJECT(func), args, &rval) == JS_FALSE) {
                 /* Exception was thrown */
                 XSRETURN_UNDEF;
             }

Modified: trunk/libjavascript-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/MANIFEST?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/MANIFEST (original)
+++ trunk/libjavascript-perl/MANIFEST Sat Aug  9 23:32:08 2008
@@ -26,6 +26,14 @@
 PJS_Types.h
 README
 TODO
+dev_tests/bad_eval.pl
+dev_tests/bind_value.pl
+dev_tests/cx_leaktest.pl
+dev_tests/leaktest.pl
+dev_tests/memory_consumption.pl
+dev_tests/refs.pl
+dev_tests/returns.pl
+dev_tests/roundtrip.pl
 lib/JavaScript.pm
 lib/JavaScript/Boxed.pm
 lib/JavaScript/Context.pm
@@ -64,6 +72,7 @@
 t/28-test-javascript-more.t
 t/29-exceptions.t
 t/30-refcount.t
+t/31-version.t
 t/99-bottles-of-beer.t
 t/lib/DummyClass.pm
 t/pod-coverage.t

Modified: trunk/libjavascript-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/META.yml?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/META.yml (original)
+++ trunk/libjavascript-perl/META.yml Sat Aug  9 23:32:08 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                JavaScript
-version:             1.08
+version:             1.09
 abstract:            Perl extension for executing embedded JavaScript
 license:             perl
 author:              

Modified: trunk/libjavascript-perl/PJS_Context.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/PJS_Context.c?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/PJS_Context.c (original)
+++ trunk/libjavascript-perl/PJS_Context.c Sat Aug  9 23:32:08 2008
@@ -221,11 +221,11 @@
     return status;
 }
 
-JSContext *
+/*JSContext *
 PJS_GetJSContext(PJS_Context *fromContext) {
     if (fromContext != NULL) {
         return fromContext->cx;
     }
     
     return NULL;
-}
+}*/

Modified: trunk/libjavascript-perl/PJS_Context.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/PJS_Context.h?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/PJS_Context.h (original)
+++ trunk/libjavascript-perl/PJS_Context.h Sat Aug  9 23:32:08 2008
@@ -88,8 +88,10 @@
     @param fromContext The context to search in
     @result A pointer to the underlying JSContext
 */
-PJS_EXTERN JSContext *
-PJS_GetJSContext(PJS_Context *fromContext);
+#define PJS_GetJSContext(fromContext) (fromContext->cx)
+
+/*PJS_EXTERN JSContext *
+PJS_GetJSContext(PJS_Context *fromContext);*/
 
 /*! @function PJS_GetClassByName
     @abstract Retrieve a bound class from a context

Modified: trunk/libjavascript-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/debian/changelog?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/debian/changelog (original)
+++ trunk/libjavascript-perl/debian/changelog Sat Aug  9 23:32:08 2008
@@ -1,5 +1,6 @@
-libjavascript-perl (1.08-2) UNRELEASED; urgency=low
+libjavascript-perl (1.09-1) UNRELEASED; urgency=low
 
+  * New upstream release.
   * Add debian/README.source to document quilt usage, as required by
     Debian Policy since 3.8.0.
 

Modified: trunk/libjavascript-perl/lib/JavaScript.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/lib/JavaScript.pm?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/lib/JavaScript.pm (original)
+++ trunk/libjavascript-perl/lib/JavaScript.pm Sat Aug  9 23:32:08 2008
@@ -23,7 +23,7 @@
 
 our %EXPORT_TAGS = ( all => [@EXPORT_OK] );
 
-our $VERSION = '1.08';
+our $VERSION = '1.09';
 
 our $MAXBYTES = 1024 ** 2;
 

Modified: trunk/libjavascript-perl/lib/JavaScript/Context.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/lib/JavaScript/Context.pm?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/lib/JavaScript/Context.pm (original)
+++ trunk/libjavascript-perl/lib/JavaScript/Context.pm Sat Aug  9 23:32:08 2008
@@ -310,6 +310,17 @@
     return $script;
 }
 
+sub get_version {
+    my ($self, $version) = @_;
+    return jsc_get_version($self->{_impl});
+}
+
+sub set_version {
+    my ($self, $version) = @_;
+    jsc_set_version($self->{_impl}, $version);
+    1;
+}
+
 sub _destroy {
     my $self = shift;
     return unless $self->{'_impl'};
@@ -496,6 +507,19 @@
 
 The handler is called when a script branches backwards during execution, when a function returns and the end of the script. To continue execution the handler must return a true value. To abort execution either throw an exception or return a false value.
 
+=item get_version ( )
+
+Returns the runtime version of the context as a string, for exmaple C<1.7> or or C<ECMAv3>.
+
+=item set_version ( $version )
+
+Sets the runtime version of the context to that specified in the string I<$version>. Some features 
+such as C<let> and C<yield> might not be enabled by default and thus must be turned on by 
+specifying what JS version we're using.
+
+A list of these can be found at L<http://developer.mozilla.org/en/docs/JSVersion> but may vary 
+depending on the version of your runtime.
+
 =back
 
 =begin PRIVATE
@@ -556,6 +580,14 @@
 
 Attaches a branch handler to the context. No check is made to see if I<handler> is a valid SVt_PVCV.
 
+=item jsc_get_version ( PJS_Context *context )
+
+Returns the version of the context as a string, for example "1.7"
+
+=item jsc_set_version ( PJS_Context *context, const char *version) 
+
+Set the version of the context to the one specified in version.
+
 =back
 
 =end PRIVATE

Modified: trunk/libjavascript-perl/lib/JavaScript/Runtime.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/lib/JavaScript/Runtime.pm?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/lib/JavaScript/Runtime.pm (original)
+++ trunk/libjavascript-perl/lib/JavaScript/Runtime.pm Sat Aug  9 23:32:08 2008
@@ -124,7 +124,7 @@
 
 =head1 NAME
 
-JavaScript::Runtime -
+JavaScript::Runtime - Runs contexts
 
 =head1 DESCRIPTION
 

Modified: trunk/libjavascript-perl/lib/Test/JavaScript/More.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/lib/Test/JavaScript/More.pm?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/lib/Test/JavaScript/More.pm (original)
+++ trunk/libjavascript-perl/lib/Test/JavaScript/More.pm Sat Aug  9 23:32:08 2008
@@ -112,6 +112,7 @@
 1;
 
 __END__
+
 =head1 NAME
 
 Test::JavaScript::More - test javascript code

Modified: trunk/libjavascript-perl/typemap
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/typemap?rev=24034&op=diff
==============================================================================
--- trunk/libjavascript-perl/typemap (original)
+++ trunk/libjavascript-perl/typemap Sat Aug  9 23:32:08 2008
@@ -7,6 +7,7 @@
 jsval                   jsval
 
 OUTPUT
+
 jsval
     {
         SV *orz = sv_newmortal();




More information about the Pkg-perl-cvs-commits mailing list