Changeset 6032
- Timestamp:
- 08/03/05 16:31:44 (3 years ago)
- svk:copy_cache_prev:
- 8154
- Files:
-
- 2 added
- 6 modified
-
debian/pugs-modules.install (modified) (2 props)
-
perl5/PIL2JS/lib/PIL/PApp.pm (modified) (1 diff)
-
perl5/PIL2JS/lib6/Prelude/JS.pm (modified) (1 diff)
-
perl5/PIL2JS/lib6/Prelude/JS/Array.pm (modified) (1 diff)
-
perl5/PIL2JS/lib6/Prelude/JS/Context.pm (added)
-
perl5/PIL2JS/lib6/Prelude/JS/Math.pm (added)
-
perl5/PIL2JS/libjs/PIL2JS.js (modified) (1 diff)
-
t/builtins/math/trig.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
debian/pugs-modules.install
- Property svn:mime-type set to text/plain; charset=UTF-8
- Property svn:eol-style set to native
-
perl5/PIL2JS/lib/PIL/PApp.pm
r5990 r6032 75 75 $native++ if 76 76 defined $obj and $obj =~ /^[\&\$\@\+\%\:]\*?JS::/; 77 $native++ if 78 defined $obj and $subname =~ /^&\*?JS::/; 77 79 78 80 # The sub is a reference? ==> We can't know at compile-time. -
perl5/PIL2JS/lib6/Prelude/JS.pm
r6000 r6032 24 24 use Prelude::JS::Hash; 25 25 use Prelude::JS::Array; 26 use Prelude::JS::Context; 27 use Prelude::JS::Math; 26 28 27 29 method JS::Root::undefine($a is rw:) { -
perl5/PIL2JS/lib6/Prelude/JS/Array.pm
r6024 r6032 164 164 $sum += +$_ for @vals; 165 165 $sum; 166 } 167 168 method reverse(*@things is copy:) { 169 # Hack, should of course use context info, but that's not here yet. 170 if @things == 1 { 171 JS::inline('(function (str) { return str.split("").reverse().join("") })')(@things[0]); 172 } else { 173 JS::inline('new PIL2JS.Box.Constant(function (args) { 174 var arr = args[1].FETCH(); 175 arr.reverse(); 176 return new PIL2JS.Box.Constant(arr); 177 })')(@things); 178 } 166 179 } 167 180 -
perl5/PIL2JS/libjs/PIL2JS.js
r6025 r6032 635 635 _26main_3a_3asay.FETCH()([ 636 636 PIL2JS.Context.Void, 637 _26main_3a_3aprefix_3a_7e.FETCH()([PIL2JS.Context.ItemAny, err.pil2js_orig_msg]) 637 _26main_3a_3aprefix_3a_7e.FETCH()([ 638 PIL2JS.Context.ItemAny, 639 err.pil2js_orig_msg 640 ? err.pil2js_orig_msg 641 : new PIL2JS.Box.Constant(err.toString()) 642 ]) 638 643 ]); 639 644 }; -
t/builtins/math/trig.t
r3702 r6032 4 4 use Test; 5 5 6 plan 45; 7 # force_todo 2 .. 8, 12 .. 20; 6 plan 51; 8 7 9 8 =head1 DESCRIPTION … … 90 89 ok(approx(tan(7/4*$PI), -1)); 91 90 ok(approx(tan(8/4*$PI), 0)); 91 92 # asin 93 ok(approx(try{asin(0)}, 0)); 94 ok(approx(try{asin(1/2*sqrt(2))}, 1/4*$PI), :todo<feature>); 95 ok(approx(try{asin(1)}, 2/4*$PI), :todo<feature>); 96 97 # acos 98 ok(approx(try{acos(0)}, 2/4*$PI), :todo<feature>); 99 ok(approx(try{acos(1/2*sqrt(2))}, 1/4*$PI), :todo<feature>); 100 ok(approx(try{acos(1)}, 0/4*$PI));
