Skip to content

Commit 4a6aa1a

Browse files
committed
[Truffle] Translate UnsupportedSpecializationException to TypeError rather than TruffleError.
1 parent 422d460 commit 4a6aa1a

40 files changed

+1
-105
lines changed

core/src/main/java/org/jruby/truffle/nodes/methods/ExceptionTranslatingNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private RubyException translate(UnsupportedSpecializationException exception) {
116116
}
117117
}
118118

119-
return getContext().getCoreLibrary().internalError(builder.toString(), this);
119+
return getContext().getCoreLibrary().typeError(builder.toString(), this);
120120
}
121121

122122
public RubyException translate(Throwable throwable) {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
fails:Array#at tries to convert the passed argument to an Integer using #to_int
2-
fails:Array#at raises a TypeError when the passed argument can't be coerced to Integer
32
fails:Array#at raises an ArgumentError when 2 or more arguments is passed

spec/truffle/tags/core/array/initialize_tags.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ fails:Array#initialize with no arguments makes the array empty
55
fails:Array#initialize with no arguments does not use the given block
66
fails:Array#initialize with (array) does not use the given block
77
fails:Array#initialize with (array) calls #to_ary to convert the value to an array
8-
fails:Array#initialize with (array) raises a TypeError if an Array type argument and a default object
98
fails:Array#initialize with (size, object=nil) sets the array to size and fills with nil when object is omitted
109
fails:Array#initialize with (size, object=nil) raises an ArgumentError if size is negative
1110
fails:Array#initialize with (size, object=nil) raises an ArgumentError if size is too large
1211
fails:Array#initialize with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is given
1312
fails:Array#initialize with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is not given
14-
fails:Array#initialize with (size, object=nil) raises a TypeError if the size argument is not an Integer type
1513
fails:Array#initialize with (size, object=nil) uses the block value instead of using the default value
1614
fails:Array#initialize with (size, object=nil) returns the value passed to break
1715
fails:Array#initialize with (size, object=nil) sets the array to the values returned by the block before break is executed

spec/truffle/tags/core/array/join_tags.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ fails:Array#join fails for arrays with incompatibly-encoded strings
1616
fails:Array#join does not separate elements when the passed separator is nil
1717
fails:Array#join calls #to_str to convert the separator to a String
1818
fails:Array#join does not call #to_str on the separator if the array is empty
19-
fails:Array#join raises a TypeError if the separator cannot be coerced to a String by calling #to_str
20-
fails:Array#join raises a TypeError if passed false as the separator
2119
fails:Array#join with a tainted separator does not taint the result if the array is empty
2220
fails:Array#join with a tainted separator does not taint the result if the array has only one element
2321
fails:Array#join with a tainted separator taints the result if the array has two or more elements

spec/truffle/tags/core/array/minus_tags.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
fails:Array#- tries to convert the passed arguments to Arrays using #to_ary
2-
fails:Array#- raises a TypeError if the argument cannot be coerced to an Array by calling #to_ary
32
fails:Array#- does not return subclass instance for Array subclasses
43
fails:Array#- does not call to_ary on array subclasses
54
fails:Array#- removes an item identified as equivalent via #hash and #eql?

spec/truffle/tags/core/array/multiply_tags.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
fails:Array#* tries to convert the passed argument to a String using #to_str
22
fails:Array#* tires to convert the passed argument to an Integer using #to_int
3-
fails:Array#* raises a TypeError if the argument can neither be converted to a string nor an integer
43
fails:Array#* converts the passed argument to a String rather than an Integer
5-
fails:Array#* raises a TypeError is the passed argument is nil
64
fails:Array#* with an integer properly handles recursive arrays
75
fails:Array#* with an integer raises an ArgumentError when passed a negative integer
86
fails:Array#* with an integer copies the taint status of the original array even if the passed count is 0

spec/truffle/tags/core/array/new_tags.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ fails:Array.new with no arguments returns an empty array
33
fails:Array.new with no arguments does not use the given block
44
fails:Array.new with (array) does not use the given block
55
fails:Array.new with (array) calls #to_ary to convert the value to an array
6-
fails:Array.new with (array) raises a TypeError if an Array type argument and a default object
76
fails:Array.new with (size, object=nil) returns an array of size filled with nil when object is omitted
87
fails:Array.new with (size, object=nil) raises an ArgumentError if size is negative
98
fails:Array.new with (size, object=nil) raises an ArgumentError if size is too large
109
fails:Array.new with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is given
1110
fails:Array.new with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is not given
12-
fails:Array.new with (size, object=nil) raises a TypeError if the size argument is not an Integer type
1311
fails:Array.new with (size, object=nil) uses the block value instead of using the default value
1412
fails:Array.new with (size, object=nil) returns the value passed to break

spec/truffle/tags/core/array/pack/a_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'A' raises a TypeError when passed nil
2-
fails:Array#pack with format 'A' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'A' ignores whitespace in the format string
42
fails:Array#pack with format 'A' calls #to_str to coerce the directives string
53
fails:Array#pack with format 'A' taints the output string if the format string is tainted
@@ -17,8 +15,6 @@ fails:Array#pack with format 'A' returns a untrusted string when the format is u
1715
fails:Array#pack with format 'A' returns a untrusted string when the empty format is untrusted
1816
fails:Array#pack with format 'A' returns a untrusted string when a pack argument is untrusted
1917
fails:Array#pack with format 'A' returns a trusted string when the array is untrusted
20-
fails:Array#pack with format 'a' raises a TypeError when passed nil
21-
fails:Array#pack with format 'a' raises a TypeError when passed an Integer
2218
fails:Array#pack with format 'a' ignores whitespace in the format string
2319
fails:Array#pack with format 'a' calls #to_str to coerce the directives string
2420
fails:Array#pack with format 'a' taints the output string if the format string is tainted

spec/truffle/tags/core/array/pack/at_tags.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format '@' raises a TypeError when passed nil
2-
fails:Array#pack with format '@' raises a TypeError when passed an Integer
31
fails:Array#pack with format '@' ignores whitespace in the format string
42
fails:Array#pack with format '@' calls #to_str to coerce the directives string
53
fails:Array#pack with format '@' taints the output string if the format string is tainted

spec/truffle/tags/core/array/pack/b_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
fails:Array#pack with format 'B' raises a TypeError when passed nil
2-
fails:Array#pack with format 'B' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'B' ignores whitespace in the format string
42
fails:Array#pack with format 'B' calls #to_str to coerce the directives string
53
fails:Array#pack with format 'B' taints the output string if the format string is tainted
64
fails:Array#pack with format 'B' raises an ArgumentError if there are fewer elements than the format requires
75
fails:Array#pack with format 'B' raises a TypeError if the object does not respond to #to_str
86
fails:Array#pack with format 'B' raises a TypeError if #to_str does not return a String
97
fails:Array#pack with format 'B' calls #to_str to convert an Object to a String
10-
fails:Array#pack with format 'b' raises a TypeError when passed nil
11-
fails:Array#pack with format 'b' raises a TypeError when passed an Integer
128
fails:Array#pack with format 'b' ignores whitespace in the format string
139
fails:Array#pack with format 'b' calls #to_str to coerce the directives string
1410
fails:Array#pack with format 'b' taints the output string if the format string is tainted

spec/truffle/tags/core/array/pack/c_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'C' raises a TypeError when passed nil
2-
fails:Array#pack with format 'C' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'C' ignores whitespace in the format string
42
fails:Array#pack with format 'C' calls #to_str to coerce the directives string
53
fails:Array#pack with format 'C' taints the output string if the format string is tainted
@@ -11,8 +9,6 @@ fails:Array#pack with format 'C' raises a TypeError when the object does not res
119
fails:Array#pack with format 'C' raises a TypeError when passed a String
1210
fails:Array#pack with format 'C' raises ArgumentError when the format modifier is '_'
1311
fails:Array#pack with format 'C' raises ArgumentError when the format modifier is '!'
14-
fails:Array#pack with format 'c' raises a TypeError when passed nil
15-
fails:Array#pack with format 'c' raises a TypeError when passed an Integer
1612
fails:Array#pack with format 'c' ignores whitespace in the format string
1713
fails:Array#pack with format 'c' calls #to_str to coerce the directives string
1814
fails:Array#pack with format 'c' taints the output string if the format string is tainted

spec/truffle/tags/core/array/pack/d_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'D' raises a TypeError when passed nil
2-
fails:Array#pack with format 'D' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'D' calls #to_str to coerce the directives string
42
fails:Array#pack with format 'D' taints the output string if the format string is tainted
53
fails:Array#pack with format 'D' raises an ArgumentError if there are fewer elements than the format requires
@@ -11,8 +9,6 @@ fails:Array#pack with format 'D' raises a TypeError if a String does not represe
119
fails:Array#pack with format 'D' raises a TypeError when the object does not respond to #to_f
1210
fails:Array#pack with format 'D' raises a TypeError if passed a String representation of a floating point number
1311
fails:Array#pack with format 'D' encodes NaN
14-
fails:Array#pack with format 'd' raises a TypeError when passed nil
15-
fails:Array#pack with format 'd' raises a TypeError when passed an Integer
1612
fails:Array#pack with format 'd' calls #to_str to coerce the directives string
1713
fails:Array#pack with format 'd' taints the output string if the format string is tainted
1814
fails:Array#pack with format 'd' raises an ArgumentError if there are fewer elements than the format requires

spec/truffle/tags/core/array/pack/e_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'E' raises a TypeError when passed nil
2-
fails:Array#pack with format 'E' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'E' calls #to_str to coerce the directives string
42
fails:Array#pack with format 'E' taints the output string if the format string is tainted
53
fails:Array#pack with format 'E' raises an ArgumentError if there are fewer elements than the format requires
@@ -11,8 +9,6 @@ fails:Array#pack with format 'E' raises a TypeError if a String does not represe
119
fails:Array#pack with format 'E' raises a TypeError when the object does not respond to #to_f
1210
fails:Array#pack with format 'E' raises a TypeError if passed a String representation of a floating point number
1311
fails:Array#pack with format 'E' encodes NaN
14-
fails:Array#pack with format 'e' raises a TypeError when passed nil
15-
fails:Array#pack with format 'e' raises a TypeError when passed an Integer
1612
fails:Array#pack with format 'e' calls #to_str to coerce the directives string
1713
fails:Array#pack with format 'e' taints the output string if the format string is tainted
1814
fails:Array#pack with format 'e' raises an ArgumentError if there are fewer elements than the format requires

spec/truffle/tags/core/array/pack/f_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'F' raises a TypeError when passed nil
2-
fails:Array#pack with format 'F' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'F' calls #to_str to coerce the directives string
42
fails:Array#pack with format 'F' taints the output string if the format string is tainted
53
fails:Array#pack with format 'F' raises an ArgumentError if there are fewer elements than the format requires
@@ -11,8 +9,6 @@ fails:Array#pack with format 'F' raises a TypeError if a String does not represe
119
fails:Array#pack with format 'F' raises a TypeError when the object does not respond to #to_f
1210
fails:Array#pack with format 'F' raises a TypeError if passed a String representation of a floating point number
1311
fails:Array#pack with format 'F' encodes NaN
14-
fails:Array#pack with format 'f' raises a TypeError when passed nil
15-
fails:Array#pack with format 'f' raises a TypeError when passed an Integer
1612
fails:Array#pack with format 'f' calls #to_str to coerce the directives string
1713
fails:Array#pack with format 'f' taints the output string if the format string is tainted
1814
fails:Array#pack with format 'f' raises an ArgumentError if there are fewer elements than the format requires

spec/truffle/tags/core/array/pack/g_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'G' raises a TypeError when passed nil
2-
fails:Array#pack with format 'G' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'G' calls #to_str to coerce the directives string
42
fails:Array#pack with format 'G' taints the output string if the format string is tainted
53
fails:Array#pack with format 'G' raises an ArgumentError if there are fewer elements than the format requires
@@ -11,8 +9,6 @@ fails:Array#pack with format 'G' raises a TypeError if a String does not represe
119
fails:Array#pack with format 'G' raises a TypeError when the object does not respond to #to_f
1210
fails:Array#pack with format 'G' raises a TypeError if passed a String representation of a floating point number
1311
fails:Array#pack with format 'G' encodes NaN
14-
fails:Array#pack with format 'g' raises a TypeError when passed nil
15-
fails:Array#pack with format 'g' raises a TypeError when passed an Integer
1612
fails:Array#pack with format 'g' calls #to_str to coerce the directives string
1713
fails:Array#pack with format 'g' taints the output string if the format string is tainted
1814
fails:Array#pack with format 'g' raises an ArgumentError if there are fewer elements than the format requires

spec/truffle/tags/core/array/pack/h_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
fails:Array#pack with format 'H' raises a TypeError when passed nil
2-
fails:Array#pack with format 'H' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'H' ignores whitespace in the format string
42
fails:Array#pack with format 'H' calls #to_str to coerce the directives string
53
fails:Array#pack with format 'H' taints the output string if the format string is tainted
64
fails:Array#pack with format 'H' raises an ArgumentError if there are fewer elements than the format requires
75
fails:Array#pack with format 'H' raises a TypeError if the object does not respond to #to_str
86
fails:Array#pack with format 'H' raises a TypeError if #to_str does not return a String
97
fails:Array#pack with format 'H' calls #to_str to convert an Object to a String
10-
fails:Array#pack with format 'h' raises a TypeError when passed nil
11-
fails:Array#pack with format 'h' raises a TypeError when passed an Integer
128
fails:Array#pack with format 'h' ignores whitespace in the format string
139
fails:Array#pack with format 'h' calls #to_str to coerce the directives string
1410
fails:Array#pack with format 'h' taints the output string if the format string is tainted

spec/truffle/tags/core/array/pack/i_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'I' raises a TypeError when passed nil
2-
fails:Array#pack with format 'I' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'I' ignores whitespace in the format string
42
fails:Array#pack with format 'I' calls #to_str to coerce the directives string
53
fails:Array#pack with format 'I' taints the output string if the format string is tainted
@@ -8,8 +6,6 @@ fails:Array#pack with format 'I' raises a TypeError when passed true
86
fails:Array#pack with format 'I' raises a TypeError when passed false
97
fails:Array#pack with format 'I' raises a TypeError when the object does not respond to #to_int
108
fails:Array#pack with format 'I' raises a TypeError when passed a String
11-
fails:Array#pack with format 'i' raises a TypeError when passed nil
12-
fails:Array#pack with format 'i' raises a TypeError when passed an Integer
139
fails:Array#pack with format 'i' ignores whitespace in the format string
1410
fails:Array#pack with format 'i' calls #to_str to coerce the directives string
1511
fails:Array#pack with format 'i' taints the output string if the format string is tainted

spec/truffle/tags/core/array/pack/l_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'L' raises a TypeError when passed nil
2-
fails:Array#pack with format 'L' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'L' ignores whitespace in the format string
42
fails:Array#pack with format 'L' calls #to_str to coerce the directives string
53
fails:Array#pack with format 'L' taints the output string if the format string is tainted
@@ -8,8 +6,6 @@ fails:Array#pack with format 'L' raises a TypeError when passed true
86
fails:Array#pack with format 'L' raises a TypeError when passed false
97
fails:Array#pack with format 'L' raises a TypeError when the object does not respond to #to_int
108
fails:Array#pack with format 'L' raises a TypeError when passed a String
11-
fails:Array#pack with format 'l' raises a TypeError when passed nil
12-
fails:Array#pack with format 'l' raises a TypeError when passed an Integer
139
fails:Array#pack with format 'l' ignores whitespace in the format string
1410
fails:Array#pack with format 'l' calls #to_str to coerce the directives string
1511
fails:Array#pack with format 'l' taints the output string if the format string is tainted

spec/truffle/tags/core/array/pack/m_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'M' raises a TypeError when passed nil
2-
fails:Array#pack with format 'M' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'M' ignores whitespace in the format string
42
fails:Array#pack with format 'M' calls #to_str to coerce the directives string
53
fails:Array#pack with format 'M' taints the output string if the format string is tainted
@@ -9,8 +7,6 @@ fails:Array#pack with format 'M' calls #to_s to convert an object to a String
97
fails:Array#pack with format 'M' converts the object to a String representation if #to_s does not return a String
108
fails:Array#pack with format 'M' encodes a Symbol as a String
119
fails:Array#pack with format 'M' encodes an Integer as a String
12-
fails:Array#pack with format 'm' raises a TypeError when passed nil
13-
fails:Array#pack with format 'm' raises a TypeError when passed an Integer
1410
fails:Array#pack with format 'm' ignores whitespace in the format string
1511
fails:Array#pack with format 'm' calls #to_str to coerce the directives string
1612
fails:Array#pack with format 'm' taints the output string if the format string is tainted

spec/truffle/tags/core/array/pack/n_tags.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fails:Array#pack with format 'N' raises a TypeError when passed nil
2-
fails:Array#pack with format 'N' raises a TypeError when passed an Integer
31
fails:Array#pack with format 'N' ignores whitespace in the format string
42
fails:Array#pack with format 'N' calls #to_str to coerce the directives string
53
fails:Array#pack with format 'N' taints the output string if the format string is tainted
@@ -11,8 +9,6 @@ fails:Array#pack with format 'N' raises a TypeError when passed a String
119
fails:Array#pack with format 'N' raises ArgumentError when the format modifier is '_'
1210
fails:Array#pack with format 'N' raises ArgumentError when the format modifier is '!'
1311
fails:Array#pack with format 'N' calls #to_int to convert the pack argument to an Integer
14-
fails:Array#pack with format 'n' raises a TypeError when passed nil
15-
fails:Array#pack with format 'n' raises a TypeError when passed an Integer
1612
fails:Array#pack with format 'n' ignores whitespace in the format string
1713
fails:Array#pack with format 'n' calls #to_str to coerce the directives string
1814
fails:Array#pack with format 'n' taints the output string if the format string is tainted

0 commit comments

Comments
 (0)