From 1ba0d8baf1cbccfa63207fd543c16fe9e57d2109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 20 Mar 2014 12:12:50 +0100 Subject: [PATCH] [NEWS] Document WeakRef to raise with unsupported classes. --- NEWS | 3 +++ test/test/spec/weakref_spec.rb | 5 +++++ vm | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) 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