r48025 - in /trunk/libjavascript-perl: ./ debian/ lib/ lib/JavaScript/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Tue Dec 1 00:54:57 UTC 2009
Author: jawnsy-guest
Date: Tue Dec 1 00:54:50 2009
New Revision: 48025
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=48025
Log:
* New upstream release
* Add myself to Uploaders and Copyright
* Rewrote control description
Added:
trunk/libjavascript-perl/._Changes
- copied unchanged from r48024, branches/upstream/libjavascript-perl/current/._Changes
trunk/libjavascript-perl/._Makefile.PL
- copied unchanged from r48024, branches/upstream/libjavascript-perl/current/._Makefile.PL
trunk/libjavascript-perl/lib/._JavaScript.pm
- copied unchanged from r48024, branches/upstream/libjavascript-perl/current/lib/._JavaScript.pm
trunk/libjavascript-perl/lib/JavaScript/Generator.pm
- copied unchanged from r48024, branches/upstream/libjavascript-perl/current/lib/JavaScript/Generator.pm
trunk/libjavascript-perl/t/36-generator.t
- copied unchanged from r48024, branches/upstream/libjavascript-perl/current/t/36-generator.t
Modified:
trunk/libjavascript-perl/CREDITS
trunk/libjavascript-perl/Changes
trunk/libjavascript-perl/MANIFEST
trunk/libjavascript-perl/META.yml
trunk/libjavascript-perl/Makefile.PL
trunk/libjavascript-perl/PJS_Common.h
trunk/libjavascript-perl/PJS_Runtime.c
trunk/libjavascript-perl/PJS_TypeConversion.c
trunk/libjavascript-perl/debian/changelog
trunk/libjavascript-perl/debian/control
trunk/libjavascript-perl/lib/JavaScript.pm
trunk/libjavascript-perl/t/23-unicode.t
Modified: trunk/libjavascript-perl/CREDITS
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/CREDITS?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/CREDITS (original)
+++ trunk/libjavascript-perl/CREDITS Tue Dec 1 00:54:50 2009
@@ -15,6 +15,10 @@
Toru Yamaguchi
Daniel Burke
Gavin Carr
+Salvador Ortiz Garcia
+Sergey Zhuravlev
+Apachez
+Dominic Mitchell
-- And it wouldn't be possible without the extraordinary works by
Modified: trunk/libjavascript-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/Changes?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/Changes (original)
+++ trunk/libjavascript-perl/Changes Tue Dec 1 00:54:50 2009
@@ -1,5 +1,12 @@
Revision history for Perl extension JavaScript.
+1.13 2009-11-30
+ - Fixes compilation issues agains SM from MacPorts. [rt.cpan.org #48702] (Dominic Mitchell)
+ - Fixes compilation issues on Win32 (Apachez)
+ - Don't try to reinit UTF8 cstrings if already done as that'll assert libjs
+ - Don't consume the elements of arrays when converting to JS. [rt.cpan.org #46356] (Sergey Zhuravlev)
+ - Added support for Generators (James Duncan)
+
1.12 2009-04-04
- Guard against stack corruption (Salvador Ortiz Garcia)
- 64-bit build issues (Salvador Ortiz Garcia)
Modified: trunk/libjavascript-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/MANIFEST?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/MANIFEST (original)
+++ trunk/libjavascript-perl/MANIFEST Tue Dec 1 00:54:50 2009
@@ -19,6 +19,7 @@
lib/JavaScript/Context.pm
lib/JavaScript/Error.pm
lib/JavaScript/Function.pm
+lib/JavaScript/Generator.pm
lib/JavaScript/PerlArray.pm
lib/JavaScript/PerlHash.pm
lib/JavaScript/Runtime.pm
@@ -88,6 +89,7 @@
t/33-perlhash.t
t/34-options.t
t/35-regexp.t
+t/36-generator.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=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/META.yml (original)
+++ trunk/libjavascript-perl/META.yml Tue Dec 1 00:54:50 2009
@@ -1,25 +1,15 @@
--- #YAML:1.0
-name: JavaScript
-version: 1.12
-abstract: Perl extension for executing embedded JavaScript
-author:
+name: JavaScript
+version: 1.13
+abstract: Perl extension for executing embedded JavaScript
+license: perl
+author:
- Claes Jakobsson <claesjac at cpan.org>
-license: perl
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
-build_requires:
- ExtUtils::MakeMaker: 0
-requires:
- Test::Exception: 0
- Test::More: 0
-resources:
- repository: svn://svn.versed.se/public/Perl/modules/JavaScript
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.50
+generated_by: ExtUtils::MakeMaker version 6.42
+distribution_type: module
+requires:
+ Test::Exception: 0
+ Test::More: 0
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
Modified: trunk/libjavascript-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/Makefile.PL?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/Makefile.PL (original)
+++ trunk/libjavascript-perl/Makefile.PL Tue Dec 1 00:54:50 2009
@@ -17,7 +17,7 @@
my $path_separator = ":";
if($^O eq "MSWin32") {
- push @defines, "XP_PC";
+ push @defines, "XP_WIN";
$path_separator = ";";
} else {
push @defines, "XP_UNIX";
@@ -83,9 +83,9 @@
}
-# test for DarwinPorts
-if (-d "/opt/local/include/spidermonkey") {
- push @incs, "/opt/local/include/spidermonkey";
+# test for MacPorts
+if (-d "/opt/local/include/js") {
+ push @incs, "/opt/local/include/js", "/opt/local/include/nspr";
push @libs, "/opt/local/lib";
}
@@ -175,10 +175,10 @@
close $test_script;
my $exe = tmpnam();;
- my $cc = join(" ", $Config{cc}, $libs, @ccflags, "-l${lib}", "-o", $exe, (map { "-I$_" } @incs), "test_js.c");
+ my $cc = join(" ", $Config{cc}, @ccflags, "-o", $exe, "test_js.c", "-I.", (map { "-I$_" } @incs), $libs, "-l${lib}" );
qx($cc);
if ($?) {
- print "Failed compiling test_js.c. ABORTING\n";
+ print "Failed compiling test_js.c. ABORTING\n\n$cc\n";
exit 0;
}
unlink("test_js.c");
@@ -200,6 +200,11 @@
}
# Write makefile
+my $libs_flags = "";
+if($^O eq "MSWin32") {
+ $libs_flags = ":nosearch";
+}
+
WriteMakefile(
NAME => "JavaScript",
VERSION_FROM => "lib/JavaScript.pm",
@@ -210,7 +215,7 @@
ABSTRACT_FROM => "lib/JavaScript.pm", # retrieve abstract from module
AUTHOR => "Claes Jakobsson <claesjac\@cpan.org>",
CCFLAGS => join(" ", @ccflags),
- LIBS => ["$libs -l${lib}"], # e.g., "-lm"
+ LIBS => ["$libs_flags $libs -l${lib}"], # e.g., "-lm"
INC => join(" ", map { "-I$_" } @incs),
LICENSE => "perl",
OBJECT => q/$(O_FILES)/,
Modified: trunk/libjavascript-perl/PJS_Common.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/PJS_Common.h?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/PJS_Common.h (original)
+++ trunk/libjavascript-perl/PJS_Common.h Tue Dec 1 00:54:50 2009
@@ -36,6 +36,11 @@
*/
#define PJS_FUNCTION_PACKAGE "JavaScript::Function"
+/*! @define PJS_GENERATOR_PACKAGE
+ @abstract Perl package to bless Generators into
+*/
+#define PJS_GENERATOR_PACKAGE "JavaScript::Generator"
+
/*! @define PJS_BOXED_PACKAGE
@abstract Perl package to bless boxed values into
*/
Modified: trunk/libjavascript-perl/PJS_Runtime.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/PJS_Runtime.c?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/PJS_Runtime.c (original)
+++ trunk/libjavascript-perl/PJS_Runtime.c Tue Dec 1 00:54:50 2009
@@ -59,6 +59,10 @@
}
/* Create a runtime */
+#if defined(JS_C_STRINGS_ARE_UTF8) && JS_VERSION >= 180
+static bool initialized_utf8_cstrings = FALSE;
+#endif
+
PJS_Runtime *
PJS_CreateRuntime(int maxbytes) {
PJS_Runtime *runtime;
@@ -68,8 +72,11 @@
croak("Failed to allocate memoery for PJS_Runtime");
}
-#ifdef JS_C_STRINGS_ARE_UTF8 && JS_VERSION >= 180
- JS_SetCStringsAreUTF8();
+#if defined(JS_C_STRINGS_ARE_UTF8) && JS_VERSION >= 180
+ if (initialized_utf8_cstrings == FALSE) {
+ JS_SetCStringsAreUTF8();
+ initialized_utf8_cstrings = TRUE;
+ }
#endif
runtime->rt = JS_NewRuntime(maxbytes);
Modified: trunk/libjavascript-perl/PJS_TypeConversion.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/PJS_TypeConversion.c?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/PJS_TypeConversion.c (original)
+++ trunk/libjavascript-perl/PJS_TypeConversion.c Tue Dec 1 00:54:50 2009
@@ -36,7 +36,7 @@
/* XXX: test this more */
ref = *av_fetch((AV *) SvRV(SvRV(ref)), 0, 0);
}
-
+
if (sv_isobject(ref)) { /* blessed */
PJS_Context *pcx;
PJS_Class *pjsc;
@@ -51,6 +51,12 @@
return JS_TRUE;
}
+ if (strcmp(name, PJS_GENERATOR_PACKAGE) == 0) {
+ JSObject *obj = INT2PTR(JSObject *, SvIV((SV *) SvRV(PJS_call_perl_method("content", ref, NULL))));
+ *rval = OBJECT_TO_JSVAL(obj);
+ return JS_TRUE;
+ }
+
/* ugly hack, this needs to be nicer */
if((pcx = PJS_GET_CONTEXT(cx)) == NULL) {
*rval = JSVAL_VOID;
@@ -208,7 +214,7 @@
av_length = av_len(av);
for(cnt = 0; cnt <= av_length; cnt++) {
jsval value;
- if (PJS_ConvertPerlToJSType(cx, seen, obj, av_shift(av), &value) == JS_FALSE) {
+ if (PJS_ConvertPerlToJSType(cx, seen, obj, *(av_fetch(av, cnt, 0)), &value) == JS_FALSE) {
*rval = JSVAL_VOID;
return JS_FALSE;
}
@@ -356,7 +362,9 @@
}
else if (OBJ_IS_NATIVE(object) &&
(OBJ_GET_CLASS(cx, object)->flags & JSCLASS_HAS_PRIVATE) &&
- (strcmp(OBJ_GET_CLASS(cx, object)->name, "Error") != 0)) {
+ (strcmp(OBJ_GET_CLASS(cx, object)->name, "Error") != 0) &&
+ (strcmp(OBJ_GET_CLASS(cx, object)->name, "Generator") != 0)
+ ) {
/* Object with a private means the actual perl object is there */
/* This is kludgy because function is also object with private,
we need to turn this to use hidden property on object */
@@ -366,6 +374,27 @@
return JS_TRUE;
}
}
+ else if (OBJ_IS_NATIVE(object) &&
+ (OBJ_GET_CLASS(cx, object)->flags & JSCLASS_HAS_PRIVATE) &&
+ (strcmp(OBJ_GET_CLASS(cx, object)->name, "Generator") == 0)
+ ){
+ SV *content = sv_2mortal(newRV_noinc(newSViv(PTR2IV(object))));
+ SV *pcx = sv_2mortal(newSViv(PTR2IV(PJS_GET_CONTEXT(cx))));
+ jsval *x;
+
+ Newz(1, x, 1, jsval);
+ if (x == NULL) {
+ croak("Failed to allocate memory for jsval");
+ }
+ *x = v;
+ JS_AddRoot(cx, (void *)x);
+
+ sv_setsv(*sv, PJS_call_perl_method("new",
+ newSVpv(PJS_GENERATOR_PACKAGE, 0),
+ content, pcx,
+ sv_2mortal(newSViv(PTR2IV(x))), NULL));
+ return JS_TRUE;
+ }
destroy_hv = 0;
if (!seen) {
Modified: trunk/libjavascript-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/debian/changelog?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/debian/changelog (original)
+++ trunk/libjavascript-perl/debian/changelog Tue Dec 1 00:54:50 2009
@@ -1,3 +1,11 @@
+libjavascript-perl (1.13-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * Add myself to Uploaders and Copyright
+ * Rewrote control description
+
+ -- Jonathan Yu <jawnsy at cpan.org> Mon, 30 Nov 2009 16:35:50 -0500
+
libjavascript-perl (1.12-4) unstable; urgency=low
[ Tim Retout ]
Modified: trunk/libjavascript-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/debian/control?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/debian/control (original)
+++ trunk/libjavascript-perl/debian/control Tue Dec 1 00:54:50 2009
@@ -1,13 +1,14 @@
Source: libjavascript-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7.0.50~), quilt (>= 0.46-7), libmozjs-dev,
- perl, libtest-pod-coverage-perl, libtest-pod-perl,
- libtest-exception-perl, libinline-perl
+Build-Depends: perl, debhelper (>= 7.0.50~), quilt (>= 0.46-7),
+ libmozjs-dev, libtest-pod-coverage-perl, libtest-pod-perl, libinline-perl,
+ libtest-exception-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Daniel Ruoso <daniel at ruoso.com>,
Krzysztof Krzyżaniak (eloy) <eloy at debian.org>, Niko Tyni <ntyni at debian.org>,
- gregor herrmann <gregoa at debian.org>, Tim Retout <tim at retout.co.uk>
+ gregor herrmann <gregoa at debian.org>, Tim Retout <tim at retout.co.uk>,
+ Jonathan Yu <jawnsy at cpan.org>
Standards-Version: 3.8.3
Homepage: http://search.cpan.org/dist/JavaScript/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libjavascript-perl/
@@ -16,12 +17,8 @@
Package: libjavascript-perl
Architecture: any
Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}
-Description: Perl extension for executing embedded JavaScript
- Always thought JavaScript was for web only? well, think again...
- .
- JavaScript.pm gives you the power of embedded JavaScript in your
- applications. You can write your subs, classes etc in perl and
- bind them to the JavaScript engine. Variables are converted
- between the language automatically and you don't have to worry
- about that.
-
+Description: module for executing embedded JavaScript
+ JavaScript is a Perl module that provides the power of embedded JavaScript in
+ your applications. You can write subroutines, classes, etc in Perl and bind
+ them to the JavaScript engine or vice versa. Variables are converted between
+ the languages automatically as needed.
Modified: trunk/libjavascript-perl/lib/JavaScript.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/lib/JavaScript.pm?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/lib/JavaScript.pm (original)
+++ trunk/libjavascript-perl/lib/JavaScript.pm Tue Dec 1 00:54:50 2009
@@ -23,7 +23,7 @@
our %EXPORT_TAGS = ( all => [@EXPORT_OK] );
-our $VERSION = "1.12";
+our $VERSION = "1.13";
our $MAXBYTES = 1024 ** 2;
@@ -33,6 +33,7 @@
require JavaScript::Function;
require JavaScript::Runtime;
require JavaScript::Script;
+require JavaScript::Generator;
sub get_engine_version {
my $version_str = js_get_engine_version();
Modified: trunk/libjavascript-perl/t/23-unicode.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjavascript-perl/t/23-unicode.t?rev=48025&op=diff
==============================================================================
--- trunk/libjavascript-perl/t/23-unicode.t (original)
+++ trunk/libjavascript-perl/t/23-unicode.t Tue Dec 1 00:54:50 2009
@@ -8,7 +8,7 @@
use JavaScript;
if (JavaScript->does_handle_utf8) {
- plan tests => 8;
+ plan tests => 9;
}
else {
plan skip_all => "No unicode support in SpiderMonkey";
@@ -43,4 +43,6 @@
$context->bind_value( uhash => { "\x{2668}" => 1 } );
is( $context->eval(q{uhash[ucopy]}), 1, "unicode hash keys from perl" );
-
+# Creating another runtime should work
+my $rt2 = JavaScript::Runtime->new();
+ok(1);
More information about the Pkg-perl-cvs-commits
mailing list