Skip to content

Commit 7c78cd9

Browse files
committed
white space cleanup
1 parent 7d8be11 commit 7c78cd9

File tree

18 files changed

+101
-101
lines changed

18 files changed

+101
-101
lines changed

Dev/jQuery.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
if ($text =~ s/\{(\s?)$/;/){
2323
print $text;
2424
}
25-
25+
2626
$text .= "\n";
2727
##disable debug methods
2828
if ($text !~ /duk_debug/){

Dev/parse.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
my @code;
1111

1212
while (<$file>){
13-
13+
1414
if ($_ =~ /^DUK_EXTERNAL_DECL/){
1515
$_ =~ s/^DUK_EXTERNAL_DECL(\s+?)//;
1616
$_ =~ s/;(\n)?$//;
17-
17+
1818
if ($_ !~ /duk_context \*ctx/g){
1919
next;
2020
}
@@ -73,7 +73,7 @@
7373
# $perl_function =~s/duk_context \*ctx/SV \*Obj/;
7474
$perl_function = 'aperl_' . $perl_function;
7575

76-
76+
7777
$code .= $code_type . "$perl_function {\n";
7878
$code .= "\tduk_size_t sz;\n" if $lstring;
7979

README.pod

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ JavaScript::Duktape - Perl interface to Duktape embeddable javascript engine
66
<a href="https://travis-ci.org/mamod/JavaScript-Duktape"><img src="https://travis-ci.org/mamod/JavaScript-Duktape.svg?branch=master"></a>
77

88
=head1 SYNOPSIS
9-
9+
1010
use JavaScript::Duktape;
1111

1212
##create new js context
@@ -28,7 +28,7 @@ JavaScript::Duktape - Perl interface to Duktape embeddable javascript engine
2828

2929
=head1 DESCRIPTION
3030

31-
JavaScript::Duktape implements almost all duktape javascript engine api, the c code is just
31+
JavaScript::Duktape implements almost all duktape javascript engine api, the c code is just
3232
a thin layer that maps duktape api to perl, and all other functions implemented in perl
3333
it self, so maintaing and contributing to the base code should be easy.
3434

@@ -58,7 +58,7 @@ To access vm create new context then call C<vm>
5858
my $js = JavaScript::Duktape->new();
5959
my $duk = $js->vm;
6060

61-
#now you can call Duktape API from perl
61+
#now you can call Duktape API from perl
6262

6363
$duk->push_string('print');
6464
$duk->eval();
@@ -76,15 +76,15 @@ above but with using C<dump> function to get a glance of stack top
7676
#push "print" string
7777
$duk->push_string('print');
7878
$duk->dump(); #-> [ Duktape (top=1): print ]
79-
79+
8080
#since print is a native function we need to evaluate it
8181
$duk->eval();
8282
$duk->dump(); #-> [ Duktape (top=1): function print() {/* native */} ]
8383

8484
#push one argument to print function
8585
$duk->push_string('hi');
8686
$duk->dump(); #-> [ Duktape (top=2): function print() {/* native */} hi ]
87-
87+
8888
#now call print function and pass "hi" as one argument
8989
$duk->call(1);
9090

@@ -99,7 +99,7 @@ above but with using C<dump> function to get a glance of stack top
9999

100100
=head1 VM methods
101101

102-
As a general rule all duktape api supported, but I haven't had the chance to test them all,
102+
As a general rule all duktape api supported, but I haven't had the chance to test them all,
103103
so please report any missing or failure api call and I'll try to fix
104104

105105
For the list of duktape engine API please see L<http://duktape.org/api.html>, and here is how
@@ -117,8 +117,8 @@ you can translate duktape api to perl
117117
# duk_pop(ctx);
118118

119119
#and here is how we can implement it in JavaScript::Duktape
120-
121-
$duk->push_c_function(sub {
120+
121+
$duk->push_c_function(sub {
122122
my $duk = shift;
123123
my $num1 = $duk->get_int(0);
124124
my $num2 = $duk->get_int(1);
@@ -137,12 +137,12 @@ you can translate duktape api to perl
137137
As you can see all you need to do is replacing C<duk_> with C<$duk->> and remove C<ctx> from the function call,
138138
this may sounds crazy but api tests have been generated by copying duktape tests and using search and replace tool :)
139139

140-
Besides duktape api, C<JavaScript::Duktape::Vm> implements the following methods
140+
Besides duktape api, C<JavaScript::Duktape::Vm> implements the following methods
141141

142142
=over 4
143-
143+
144144
=item push_function ( code_ref, num_of_args );
145-
145+
146146
an alias to push_c_function
147147

148148
=item push_perl( ... );
@@ -160,7 +160,7 @@ resets duktape stack top
160160
=back
161161

162162
=head1 AUTHOR
163-
163+
164164
Mamod Mehyar C<< <[email protected]> >>
165165

166166
=head1 LICENSE

lib/JavaScript/Duktape.pm

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ use constant {
101101
DUK_ENUM_SORT_ARRAY_INDICES => (1 << 4),
102102
DUK_ENUM_NO_PROXY_BEHAVIOR => (1 << 5),
103103

104-
DUK_COMPILE_EVAL => (1 << 0),
104+
DUK_COMPILE_EVAL => (1 << 0),
105105
DUK_COMPILE_FUNCTION => (1 << 1),
106106
DUK_COMPILE_STRICT => (1 << 2),
107107
DUK_COMPILE_SAFE => (1 << 3),
@@ -146,7 +146,7 @@ sub new {
146146
delete $GlobalRef->{$ref};
147147
return 1;
148148
};
149-
149+
150150
$duk->perl_push_function($self->{finalizer}, 1);
151151
$duk->put_global_string('perlFinalizer');
152152

@@ -157,7 +157,7 @@ sub new {
157157
my $top = $duk->get_top();
158158

159159
shift if ref $_[0] eq 'JavaScript::Duktape::Cache';
160-
160+
161161
$THIS->{heapptr} = $heapptr;
162162
$THIS->{duk} = $duk;
163163

@@ -174,7 +174,7 @@ sub new {
174174
$duk->push_perl($ret);
175175
return 1;
176176
};
177-
177+
178178
$duk->push_perl_function($self->{call}, -1);
179179
$duk->put_global_string('perlCall');
180180

@@ -253,7 +253,7 @@ sub eval {
253253
my $duk = $self->duk;
254254

255255
my $err = $duk->peval_string($string);
256-
256+
257257
if ($err){
258258
my $error_string = $duk->safe_to_string(-1);
259259
croak $error_string;
@@ -306,7 +306,7 @@ use Carp;
306306
sub push_perl {
307307
my $self = shift;
308308
my $val = shift;
309-
309+
310310
if (my $ref = ref $val){
311311
if ($ref eq 'JavaScript::Duktape::NULL'){
312312
$self->push_null();
@@ -368,7 +368,7 @@ sub to_perl_object {
368368
my $self = shift;
369369
my $index = shift;
370370
my $heapptr = $self->require_heapptr($index);
371-
371+
372372
return JavaScript::Duktape::Util::jsObject({
373373
duk => $self,
374374
heapptr => $heapptr
@@ -424,7 +424,7 @@ sub to_perl {
424424
#I'm not sure why I need to
425425
#substract 4 from stack top!!
426426
my $top = $self->get_top() - 4;
427-
427+
428428
$key = $self->to_perl(-2);
429429
my $found = 0;
430430
while ($top--){
@@ -463,12 +463,12 @@ sub to_perl {
463463
elsif ($type == JavaScript::Duktape::DUK_TYPE_NULL){
464464
$ret = JavaScript::Duktape::NULL::null();
465465
}
466-
466+
467467
elsif ($type == JavaScript::Duktape::DUK_TYPE_POINTER){
468468
my $p = $self->get_pointer($index);
469469
$ret = bless \$p, 'JavaScript::Duktape::Pointer';
470470
}
471-
471+
472472
return $ret;
473473
}
474474

@@ -540,7 +540,7 @@ sub push_c_function {
540540
sub cache {
541541
my $self = shift;
542542
my $sub = shift;
543-
543+
544544
my @caller = caller;
545545
my $code_cache_name = $caller[0] . $caller[2];
546546

@@ -761,14 +761,14 @@ package JavaScript::Duktape::Util; {
761761

762762
my $val = undef;
763763
$duk->get_prop_string(-1, $method);
764-
764+
765765
my $type = $duk->get_type(-1);
766766
if ($type == JavaScript::Duktape::DUK_TYPE_OBJECT ||
767767
$type == JavaScript::Duktape::DUK_TYPE_BUFFER){
768-
768+
769769
if ($duk->is_function(-1)){
770770
my $function_heap = $duk->get_heapptr(-1);
771-
771+
772772
if (@_){
773773
#called with special no arg _
774774
shift if (ref $_[0] eq 'NOARGS');
@@ -868,7 +868,7 @@ package JavaScript::Duktape::Util; {
868868
$duk->push_heapptr($heapptr);
869869
$duk->put_prop(-3); #PerlGlobalStash[heapptr] = object
870870
$duk->pop_2();
871-
871+
872872
my $type = $duk->get_type(-1);
873873

874874
##if this is a function return sub immediately
@@ -895,7 +895,7 @@ JavaScript::Duktape - Perl interface to Duktape embeddable javascript engine
895895
<a href="https://travis-ci.org/mamod/JavaScript-Duktape"><img src="https://travis-ci.org/mamod/JavaScript-Duktape.svg?branch=master"></a>
896896
897897
=head1 SYNOPSIS
898-
898+
899899
use JavaScript::Duktape;
900900
901901
##create new js context
@@ -917,7 +917,7 @@ JavaScript::Duktape - Perl interface to Duktape embeddable javascript engine
917917
918918
=head1 DESCRIPTION
919919
920-
JavaScript::Duktape implements almost all duktape javascript engine api, the c code is just
920+
JavaScript::Duktape implements almost all duktape javascript engine api, the c code is just
921921
a thin layer that maps duktape api to perl, and all other functions implemented in perl
922922
it self, so maintaing and contributing to the base code should be easy.
923923
@@ -947,7 +947,7 @@ To access vm create new context then call C<vm>
947947
my $js = JavaScript::Duktape->new();
948948
my $duk = $js->vm;
949949
950-
#now you can call Duktape API from perl
950+
#now you can call Duktape API from perl
951951
952952
$duk->push_string('print');
953953
$duk->eval();
@@ -965,15 +965,15 @@ above but with using C<dump> function to get a glance of stack top
965965
#push "print" string
966966
$duk->push_string('print');
967967
$duk->dump(); #-> [ Duktape (top=1): print ]
968-
968+
969969
#since print is a native function we need to evaluate it
970970
$duk->eval();
971971
$duk->dump(); #-> [ Duktape (top=1): function print() {/* native */} ]
972972
973973
#push one argument to print function
974974
$duk->push_string('hi');
975975
$duk->dump(); #-> [ Duktape (top=2): function print() {/* native */} hi ]
976-
976+
977977
#now call print function and pass "hi" as one argument
978978
$duk->call(1);
979979
@@ -988,7 +988,7 @@ above but with using C<dump> function to get a glance of stack top
988988
989989
=head1 VM methods
990990
991-
As a general rule all duktape api supported, but I haven't had the chance to test them all,
991+
As a general rule all duktape api supported, but I haven't had the chance to test them all,
992992
so please report any missing or failure api call and I'll try to fix
993993
994994
For the list of duktape engine API please see L<http://duktape.org/api.html>, and here is how
@@ -1006,8 +1006,8 @@ you can translate duktape api to perl
10061006
# duk_pop(ctx);
10071007
10081008
#and here is how we can implement it in JavaScript::Duktape
1009-
1010-
$duk->push_c_function(sub {
1009+
1010+
$duk->push_c_function(sub {
10111011
my $duk = shift;
10121012
my $num1 = $duk->get_int(0);
10131013
my $num2 = $duk->get_int(1);
@@ -1026,12 +1026,12 @@ you can translate duktape api to perl
10261026
As you can see all you need to do is replacing C<duk_> with C<$duk->> and remove C<ctx> from the function call,
10271027
this may sounds crazy but api tests have been generated by copying duktape tests and using search and replace tool :)
10281028
1029-
Besides duktape api, C<JavaScript::Duktape::Vm> implements the following methods
1029+
Besides duktape api, C<JavaScript::Duktape::Vm> implements the following methods
10301030
10311031
=over 4
1032-
1032+
10331033
=item push_function ( code_ref, num_of_args );
1034-
1034+
10351035
an alias to push_c_function
10361036
10371037
=item push_perl( ... );
@@ -1049,7 +1049,7 @@ resets duktape stack top
10491049
=back
10501050
10511051
=head1 AUTHOR
1052-
1052+
10531053
Mamod Mehyar C<< <[email protected]> >>
10541054
10551055
=head1 LICENSE

lib/JavaScript/Duktape/C/duktape_wrap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void perl_duk_reset_top(duk_context *ctx){
7070
/**
7171
* duk_safe_call hack
7272
* ===================
73-
*
73+
*
7474
*
7575
******************************************************************************/
7676
static SV * gCallback = (SV*)NULL;
@@ -105,7 +105,7 @@ int call_safe_perl_sub(duk_context *ctx) {
105105
}
106106

107107
duk_int_t perl_duk_safe_call(duk_context *ctx, SV *func, duk_idx_t nargs, duk_idx_t nrets) {
108-
108+
109109
duk_int_t ret = 0;
110110
if (gCallback == (SV*)NULL) {
111111
gCallback = newSVsv(func);
@@ -119,7 +119,7 @@ duk_int_t perl_duk_safe_call(duk_context *ctx, SV *func, duk_idx_t nargs, duk_id
119119
PL_top_env = old_perl_top;
120120
croak("Duk::Error");
121121
}
122-
122+
123123
return ret;
124124
}
125125

@@ -132,7 +132,7 @@ int call_perl_function(duk_context *ctx) {
132132

133133
char *error = NULL;
134134
STRLEN error_len;
135-
135+
136136
dSP;
137137
SV *sv;
138138
int count;
@@ -233,7 +233,7 @@ void DESTROY(duk_context *ctx) {
233233
//Safefree(ctx);
234234
}
235235

236-
/*
236+
/*
237237
Auto Generated C Code by parser.pl
238238
parser.pl reads duktape.h file and create both
239239
perl & C map code to Duktape API

lib/JavaScript/Duktape/C/libPath.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package
1+
package
22
JavaScript::Duktape::C::libPath;
33
use File::Spec;
44
my $file = File::Spec->rel2abs(__FILE__);

t/api/buffer-zeroed.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242

4343
__DATA__
4444
fixed: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
45-
dynamic: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
45+
dynamic: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 commit comments

Comments
 (0)