File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Bug fixes:
12
12
13
13
Compatibility
14
14
15
- * ` String#-@ ` now performs string deduplication
15
+ * ` String#-@ ` now performs string deduplication ( # 1608 ).
16
16
* ` Hash#merge ` now preserves the key order from the original hash for merged values (#1650 ).
17
17
18
18
# 1.0 RC 17
@@ -41,7 +41,7 @@ Changes:
41
41
Bug fixes:
42
42
43
43
* Fixed ` Hash#merge ` with no arguments to return a new copy of the receiver (#1645 ).
44
- * Fixed yield with a splat and keyword arguments (#1613 ).
44
+ * Fixed yield with a splat and keyword arguments (#1613 ).
45
45
* Fixed ` rb_scan_args ` to correctly handle kwargs in combination with optional args.
46
46
* Many fixes for ` FFI::Pointer ` to be more compatible with the ` ffi ` gem.
47
47
@@ -63,7 +63,6 @@ Compatibility:
63
63
* ` StringScanner ` will now match a regexp beginning with ` ^ ` even when not scanning from the start of the string.
64
64
* ` Module#define_method ` is now public like in MRI.
65
65
* ` Kernel#warn ` now supports the ` uplevel: ` keyword argument.
66
- * ` String#-@ ` now performs string deduplication (#1608 ) .
67
66
68
67
# 1.0 RC 15, 5 April 2019
69
68
Original file line number Diff line number Diff line change 41
41
42
42
( -dynamic ) . should_not equal ( "this string is frozen" . freeze )
43
43
( -dynamic ) . should_not equal ( -"this string is frozen" . freeze )
44
+ ( -dynamic ) . should == "this string is frozen"
44
45
end
45
46
46
47
it "does not deduplicate tainted strings" do
47
48
dynamic = %w( this string is frozen ) . join ( ' ' )
48
49
dynamic . taint
49
50
( -dynamic ) . should_not equal ( "this string is frozen" . freeze )
50
51
( -dynamic ) . should_not equal ( -"this string is frozen" . freeze )
52
+ ( -dynamic ) . should == "this string is frozen"
51
53
end
52
54
53
55
it "does not deduplicate strings with additional instance variables" do
54
56
dynamic = %w( this string is frozen ) . join ( ' ' )
55
57
dynamic . instance_variable_set ( :@foo , :bar )
56
58
( -dynamic ) . should_not equal ( "this string is frozen" . freeze )
57
59
( -dynamic ) . should_not equal ( -"this string is frozen" . freeze )
60
+ ( -dynamic ) . should == "this string is frozen"
58
61
end
59
62
end
60
63
Original file line number Diff line number Diff line change @@ -1591,7 +1591,9 @@ def +@
1591
1591
1592
1592
def -@
1593
1593
str = frozen? ? self : dup . freeze
1594
- unless str . tainted? || !( str . instance_variables ) . empty?
1594
+ if str . tainted? || !( str . instance_variables ) . empty?
1595
+ str
1596
+ else
1595
1597
Truffle ::Ropes . flatten_rope ( str )
1596
1598
Truffle . invoke_primitive ( :string_intern , str )
1597
1599
end
You can’t perform that action at this time.
0 commit comments