[macruby-changes] [1045] MacRuby/branches/experimental

source_changes at macosforge.org source_changes at macosforge.org
Sat Mar 21 01:03:59 PDT 2009


Revision: 1045
          http://trac.macosforge.org/projects/ruby/changeset/1045
Author:   vincent.isambart at gmail.com
Date:     2009-03-21 01:03:57 -0700 (Sat, 21 Mar 2009)
Log Message:
-----------
Fixed block arguments and corrected the last test not passing in Ruby 1.9 in test_roxor.rb

Modified Paths:
--------------
    MacRuby/branches/experimental/roxor.cpp
    MacRuby/branches/experimental/test_roxor.rb

Modified: MacRuby/branches/experimental/roxor.cpp
===================================================================
--- MacRuby/branches/experimental/roxor.cpp	2009-03-21 06:49:26 UTC (rev 1044)
+++ MacRuby/branches/experimental/roxor.cpp	2009-03-21 08:03:57 UTC (rev 1045)
@@ -5075,9 +5075,9 @@
     int dvars_size = b->dvars_size;
     rb_vm_arity_t arity = b->arity;    
 
-    if (dvars_size > 0 || argc < arity.min || argc > b->arity.max) {
+    if (dvars_size > 0 || argc < arity.min || argc > arity.max) {
 	VALUE *new_argv;
-	if (argc == 1 && TYPE(argv[0]) == T_ARRAY && arity.max > 1) {
+	if (argc == 1 && TYPE(argv[0]) == T_ARRAY && (arity.min > 1 || (arity.min == 1 && arity.min != arity.max))) {
 	    // Expand the array
 	    long ary_len = RARRAY_LEN(argv[0]);
 	    new_argv = (VALUE *)alloca(sizeof(VALUE) * ary_len);

Modified: MacRuby/branches/experimental/test_roxor.rb
===================================================================
--- MacRuby/branches/experimental/test_roxor.rb	2009-03-21 06:49:26 UTC (rev 1044)
+++ MacRuby/branches/experimental/test_roxor.rb	2009-03-21 08:03:57 UTC (rev 1045)
@@ -891,7 +891,7 @@
   assert "42", "n = 0; 100.times { |i| next if i % 2 == 0; n += 1; }; p n - 8"
   assert "42", "p 100.times { break 42 }"
   assert "42", "p proc { next 42 }.call"
-  assert "42", "p proc { break 42 }.call"
+  assert "42", "begin p proc { break 24 }.call rescue LocalJumpError; p 42 end"
 
   assert "42", "p [42].map { |x| x }.map { |y| y }[0]"
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090321/2aa9ac96/attachment.html>


More information about the macruby-changes mailing list