diff --git a/NEWS b/NEWS index a4d35e30..c1f90275 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ = RubyMotion 2.25 = + * Improved use of `WeakRef' to raise an exception when trying to create a + weak reference to one of the unsupported classes. For more information, see + `Which classes don’t support weak references?' at http://bit.ly/1iiSOaU. * Fixed a bug where KVC property validation methods defined in Ruby would not be compiled with the appropriate (Pointer) types. * Added some introspection support to `ImmediateRef'. It can now report the diff --git a/test/test/spec/weakref_spec.rb b/test/test/spec/weakref_spec.rb index 4a72f96a..5b1f104a 100644 --- a/test/test/spec/weakref_spec.rb +++ b/test/test/spec/weakref_spec.rb @@ -107,6 +107,11 @@ describe "WeakRef" do WeakRef.new(true).should == true WeakRef.new(false).should == false end + + it "raises with classes that do not support weak references" do + obj = NSMutableParagraphStyle.new + lambda { WeakRef.new(obj) }.should.raise(WeakRef::RefError) + end end describe "Proc#weak!" do diff --git a/vm b/vm index b199941d..a8a981d8 160000 --- a/vm +++ b/vm @@ -1 +1 @@ -Subproject commit b199941d59a809a3d98fe7130bc2e6aed56c95ce +Subproject commit a8a981d8f3e479e920a7fb49797d6982994bf06c