opal 0.10.0.beta2 → 0.10.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/opal/compiler.rb +15 -9
- data/lib/opal/fragment.rb +8 -1
- data/lib/opal/nodes/args/restarg.rb +6 -1
- data/lib/opal/nodes/base.rb +1 -1
- data/lib/opal/nodes/call.rb +4 -0
- data/lib/opal/nodes/def.rb +20 -25
- data/lib/opal/nodes/hash.rb +89 -17
- data/lib/opal/nodes/iter.rb +30 -2
- data/lib/opal/nodes/logic.rb +54 -4
- data/lib/opal/nodes/node_with_args.rb +72 -0
- data/lib/opal/parser.rb +16 -0
- data/lib/opal/parser/grammar.rb +2555 -2562
- data/lib/opal/parser/grammar.y +28 -20
- data/lib/opal/parser/lexer.rb +4 -4
- data/lib/opal/regexp_anchors.rb +13 -5
- data/lib/opal/source_map.rb +2 -1
- data/lib/opal/version.rb +1 -1
- data/opal/corelib/array.rb +4 -0
- data/opal/corelib/basic_object.rb +3 -1
- data/opal/corelib/constants.rb +1 -1
- data/opal/corelib/file.rb +196 -4
- data/opal/corelib/hash.rb +7 -7
- data/opal/corelib/kernel.rb +7 -4
- data/opal/corelib/marshal.rb +31 -0
- data/opal/corelib/marshal/read_buffer.rb +427 -0
- data/opal/corelib/marshal/write_buffer.rb +383 -0
- data/opal/corelib/method.rb +8 -0
- data/opal/corelib/module.rb +21 -0
- data/opal/corelib/number.rb +19 -5
- data/opal/corelib/proc.rb +33 -6
- data/opal/corelib/range.rb +6 -0
- data/opal/corelib/regexp.rb +5 -1
- data/opal/corelib/runtime.js +69 -17
- data/opal/corelib/string.rb +8 -0
- data/opal/corelib/string/inheritance.rb +4 -0
- data/opal/corelib/struct.rb +5 -0
- data/opal/corelib/unsupported.rb +0 -18
- data/opal/opal/full.rb +1 -0
- data/spec/filters/bugs/basicobject.rb +0 -2
- data/spec/filters/bugs/compiler_opal.rb +5 -0
- data/spec/filters/bugs/enumerable.rb +1 -0
- data/spec/filters/bugs/enumerator.rb +0 -2
- data/spec/filters/bugs/exception.rb +0 -1
- data/spec/filters/bugs/kernel.rb +0 -5
- data/spec/filters/bugs/language.rb +7 -27
- data/spec/filters/bugs/marshal.rb +43 -0
- data/spec/filters/bugs/method.rb +0 -56
- data/spec/filters/bugs/module.rb +0 -1
- data/spec/filters/bugs/proc.rb +0 -46
- data/spec/filters/bugs/regexp.rb +1 -0
- data/spec/filters/bugs/unboundmethod.rb +0 -13
- data/spec/filters/unsupported/bignum.rb +5 -0
- data/spec/filters/unsupported/freeze.rb +2 -0
- data/spec/filters/unsupported/marshal.rb +46 -0
- data/spec/filters/unsupported/symbol.rb +5 -0
- data/spec/lib/compiler/call_spec.rb +29 -29
- data/spec/lib/compiler_spec.rb +7 -1
- data/spec/opal/core/kernel/instance_variables_spec.rb +40 -0
- data/spec/opal/core/language/ternary_operator_spec.rb +6 -0
- data/spec/opal/core/marshal/dump_spec.rb +53 -0
- data/spec/opal/core/marshal/load_spec.rb +7 -0
- data/spec/opal/core/source_map_spec.rb +35 -1
- data/spec/opal/javascript_api_spec.rb +16 -0
- data/spec/opal/stdlib/source_map_spec.rb +8 -0
- data/spec/ruby_specs +7 -4
- data/spec/support/match_helpers.rb +57 -0
- data/spec/support/mspec_rspec_adapter.rb +1 -1
- data/stdlib/opal-parser.rb +3 -1
- data/stdlib/pathname.rb +105 -7
- data/stdlib/racc/parser.rb +551 -138
- data/stdlib/source_map/vlq.rb +3 -2
- data/tasks/testing.rake +4 -2
- metadata +22 -2
data/spec/filters/bugs/method.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
opal_filter "Method" do
|
2
|
-
fails "Method#define_method when passed a Method object defines a method with the same #parameters as the original"
|
3
2
|
fails "Method#define_method when passed an UnboundMethod object defines a method with the same #arity as the original"
|
4
3
|
fails "Method#define_method when passed an UnboundMethod object defines a method with the same #parameters as the original"
|
5
4
|
fails "Method#== returns true if methods are the same"
|
@@ -36,19 +35,6 @@ opal_filter "Method" do
|
|
36
35
|
fails "Method#owner for a Method generated by respond_to_missing? returns the owner of the method"
|
37
36
|
fails "Method#hash returns the same value for user methods that are eql?"
|
38
37
|
fails "Method#hash returns the same value for builtin methods that are eql?"
|
39
|
-
fails "Method#arity returns negative values for method definition \n def m(a=1) end\n def n(a=1, b=2) end"
|
40
|
-
fails "Method#arity returns negative values for method definition \n def m(a, b=1) end\n def n(a, b, c=1, d=2) end"
|
41
|
-
fails "Method#arity returns negative values for method definition \n def m(a=1, *b) end\n def n(a=1, b=2, *c) end"
|
42
|
-
fails "Method#arity returns negative values for method definition \n def m(*) end\n def n(*a) end"
|
43
|
-
fails "Method#arity returns negative values for method definition \n def m(a, *) end\n def n(a, *b) end\n def o(a, b, *c) end\n def p(a, b, c, *d) end"
|
44
|
-
fails "Method#arity returns negative values for method definition \n def m(*a, b) end\n def n(*a, b, c) end\n def o(*a, b, c, d) end"
|
45
|
-
fails "Method#arity returns negative values for method definition \n def m(a, *b, c) end\n def n(a, b, *c, d, e) end"
|
46
|
-
fails "Method#arity returns negative values for method definition \n def m(a, b=1, c=2, *d, e, f) end\n def n(a, b, c=1, *d, e, f, g) end"
|
47
|
-
fails "Method#arity returns negative values for method definition \n def m(a: 1) end\n def n(a: 1, b: 2) end"
|
48
|
-
fails "Method#arity returns negative values for method definition \n def m(a=1, b: 2) end\n def n(*a, b: 1) end\n def o(a=1, b: 2) end\n def p(a=1, *b, c: 2, &l) end"
|
49
|
-
fails "Method#arity returns negative values for method definition \n def m(**k, &l) end\n def n(*a, **k) end\n def o(a: 1, b: 2, **k) end"
|
50
|
-
fails "Method#arity returns negative values for method definition 'def m(a=1, *b, c:, d: 2, **k, &l) end'"
|
51
|
-
fails "Method#arity returns negative values for method definition \n def m(a, b=1, *c, d, e:, f: 2, **k, &l) end\n def n(a, b=1, *c, d:, e:, f: 2, **k, &l) end\n def o(a=0, b=1, *c, d, e:, f: 2, **k, &l) end\n def p(a=0, b=1, *c, d:, e:, f: 2, **k, &l) end"
|
52
38
|
fails "Method#arity for a Method generated by respond_to_missing? returns -1"
|
53
39
|
fails "Method#name for a Method generated by respond_to_missing? returns the name passed to respond_to_missing?"
|
54
40
|
fails "Method#inspect returns a String containing the Module the method is defined in"
|
@@ -69,47 +55,7 @@ opal_filter "Method" do
|
|
69
55
|
fails "Method#curry with optional arity argument raises ArgumentError when the method requires more arguments than the given arity"
|
70
56
|
fails "Method#curry with optional arity argument raises ArgumentError when the method requires less arguments than the given arity"
|
71
57
|
fails "Method#clone returns a copy of the method"
|
72
|
-
fails "Method#parameters returns an empty Array when the method expects no arguments"
|
73
|
-
fails "Method#parameters returns [[:req,:name]] for a method expecting one required argument called 'name'"
|
74
|
-
fails "Method#parameters returns [[:req,:a],[:req,:b]] for a method expecting two required arguments called 'a' and 'b''"
|
75
|
-
fails "Method#parameters returns [[:block,:blk]] for a method expecting one block argument called 'a'"
|
76
|
-
fails "Method#parameters returns [[:req,:a],[:block,:b] for a method expecting a required argument ('a') and a block argument ('b')"
|
77
|
-
fails "Method#parameters returns [[:req,:a],[:req,:b],[:block,:c] for a method expecting two required arguments ('a','b') and a block argument ('c')"
|
78
|
-
fails "Method#parameters returns [[:opt,:a]] for a method expecting one optional argument ('a')"
|
79
|
-
fails "Method#parameters returns [[:req,:a],[:opt,:b]] for a method expecting one required argument ('a') and one optional argument ('b')"
|
80
|
-
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:opt,:c]] for a method expecting one required argument ('a') and two optional arguments ('b','c')"
|
81
|
-
fails "Method#parameters returns [[:req,:a],[:req,:b],[:opt,:c]] for a method expecting two required arguments ('a','b') and one optional arguments ('c')"
|
82
|
-
fails "Method#parameters returns [[:opt,:a],[:block,:b]] for a method expecting one required argument ('a') and one block argument ('b')"
|
83
|
-
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:block,:c]] for a method expecting one required argument ('a'), one optional argument ('b'), and a block ('c')"
|
84
|
-
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:opt,:c],[:block,:d]] for a method expecting one required argument ('a'), two optional arguments ('b','c'), and a block ('d')"
|
85
|
-
fails "Method#parameters returns [[:rest,:a]] for a method expecting a single splat argument ('a')"
|
86
|
-
fails "Method#parameters returns [[:req,:a],[:rest,:b]] for a method expecting a splat argument ('a') and a required argument ('b')"
|
87
|
-
fails "Method#parameters returns [[:req,:a],[:req,:b],[:rest,:c]] for a method expecting two required arguments ('a','b') and a splat argument ('c')"
|
88
|
-
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:rest,:c]] for a method expecting a required argument ('a','b'), an optional argument ('b'), and a splat argument ('c')"
|
89
|
-
fails "Method#parameters returns [[:req,:a],[:req,:b],[:opt,:b],[:rest,:d]] for a method expecting two required arguments ('a','b'), an optional argument ('c'), and a splat argument ('d')"
|
90
|
-
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:opt,:c],[:rest,:d]] for a method expecting a required argument ('a'), two optional arguments ('b','c'), and a splat argument ('d')"
|
91
|
-
fails "Method#parameters returns [[:rest,:a],[:block,:b]] for a method expecting a splat argument ('a') and a block argument ('b')"
|
92
|
-
fails "Method#parameters returns [[:req,:a],[:rest,:b],[:block,:c]] for a method expecting a required argument ('a'), a splat argument ('b'), and a block ('c')"
|
93
|
-
fails "Method#parameters returns [[:req,:a],[:req,:b],[:rest,:c],[:block,:d]] for a method expecting two required arguments ('a','b'), a splat argument ('c'), and a block ('d')"
|
94
|
-
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:rest,:c],[:block,:d]] for a method expecting a required argument ('a'), a splat argument ('c'), and a block ('d')"
|
95
|
-
fails "Method#parameters returns [[:req,:a],[:req,:b],[:opt,:c],[:block,:d]] for a method expecting two required arguments ('a','b'), an optional argument ('c'), a splat argument ('d'), and a block ('e')"
|
96
|
-
fails "Method#parameters returns [[:rest,:a],[:req,:b]] for a method expecting a splat argument ('a') and a required argument ('b')"
|
97
|
-
fails "Method#parameters returns [[:rest,:a],[:req,:b],[:req,:c]] for a method expecting a splat argument ('a') and two required arguments ('b','c')"
|
98
|
-
fails "Method#parameters returns [[:rest,:a],[:req,:b],[:block,:c]] for a method expecting a splat argument ('a'), a required argument ('b'), and a block ('c')"
|
99
|
-
fails "Method#parameters returns [[:key,:a]] for a method with a single optional keyword argument"
|
100
|
-
fails "Method#parameters returns [[:keyrest,:a]] for a method with a keyword rest argument"
|
101
|
-
fails "Method#parameters returns [[:keyreq,:a]] for a method with a single required keyword argument"
|
102
|
-
fails "Method#parameters works with ->(){} as the value of an optional argument"
|
103
|
-
fails "Method#parameters returns [] for a define_method method with explicit no-args || specification"
|
104
|
-
fails "Method#parameters returns [[:rest, :x]] for a define_method method with rest arg 'x' only"
|
105
|
-
fails "Method#parameters returns [[:req, :x]] for a define_method method expecting one required argument 'x'"
|
106
|
-
fails "Method#parameters returns [[:req, :x], [:req, :y]] for a define_method method expecting two required arguments 'x' and 'y'"
|
107
|
-
fails "Method#parameters returns [] for a define_method method with no args specification"
|
108
|
-
fails "Method#parameters returns [[:req]] for a define_method method with a grouping as its only argument"
|
109
|
-
fails "Method#parameters returns [[:opt, :x]] for a define_method method with an optional argument 'x'"
|
110
58
|
fails "Method#parameters returns [[:rest]] for a Method generated by respond_to_missing?"
|
111
|
-
fails "Method#parameters adds nameless rest arg for \"star\" argument"
|
112
|
-
fails "Method#parameters returns the args and block for a splat and block argument"
|
113
59
|
fails "An element assignment method send with a single splatted Object argument does not call #to_ary"
|
114
60
|
fails "An element assignment method send with a single splatted Object argument calls #to_a"
|
115
61
|
fails "An element assignment method send with a single splatted Object argument wraps the argument in an Array if #to_a returns nil"
|
@@ -123,8 +69,6 @@ opal_filter "Method" do
|
|
123
69
|
fails "An element assignment method send with a trailing splatted Object argument calls #to_a"
|
124
70
|
fails "An element assignment method send with a trailing splatted Object argument wraps the argument in an Array if #to_a returns nil"
|
125
71
|
fails "A method assigns local variables from method parameters for definition 'def m(a:) a end'"
|
126
|
-
fails "A method assigns local variables from method parameters for definition 'def m((*), (*)) end'"
|
127
|
-
fails "A method assigns local variables from method parameters for definition 'def m(a=1, (*b), (*c)) [a, b, c] end'"
|
128
72
|
fails "A method assigns local variables from method parameters for definition 'def m(a=1, b:) [a, b] end'"
|
129
73
|
fails "A method assigns local variables from method parameters for definition 'def m(a=1, b: 2) [a, b] end'"
|
130
74
|
fails "A method assigns local variables from method parameters for definition 'def m(a=1, **) a end'"
|
data/spec/filters/bugs/module.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
opal_filter "Module" do
|
2
2
|
fails "Module#alias_method can call a method with super aliased twice"
|
3
|
-
fails "Module#alias_method preserves the arguments information of the original methods"
|
4
3
|
fails "Module#alias_method raises a TypeError when the given name can't be converted using to_str"
|
5
4
|
fails "Module#alias_method retains method visibility"
|
6
5
|
fails "Module#append_features copies own tainted status to the given module"
|
data/spec/filters/bugs/proc.rb
CHANGED
@@ -1,37 +1,7 @@
|
|
1
1
|
opal_filter "Proc" do
|
2
|
-
fails "Module#remove_method accepts multiple arguments"
|
3
|
-
fails "Module#undef_method requires multiple arguments"
|
4
2
|
fails "Proc as an implicit block pass argument remains the same object if re-vivified by the target method"
|
5
3
|
fails "Proc#=== on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError on excess arguments when self is a lambda"
|
6
4
|
fails "Proc#=== on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError on missing arguments when self is a lambda"
|
7
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition '@a = -> (a=1, *b, c:, d: 2, **k, &l) { }'"
|
8
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (*) { }\n @b = -> (*a) { }"
|
9
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (**k, &l) { }\n @b= -> (*a, **k) { }\n @c = ->(a: 1, b: 2, **k) { }"
|
10
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (*a, b) { }\n @b = -> (*a, b, c) { }\n @c = -> (*a, b, c, d) { }"
|
11
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a, *) { }\n @b = -> (a, *b) { }\n @c = -> (a, b, *c) { }\n @d = -> (a, b, c, *d) { }"
|
12
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a, *b, c) { }\n @b = -> (a, b, *c, d, e) { }"
|
13
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a, b=1) { }\n @b = -> (a, b, c=1, d=2) { }"
|
14
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a, b=1, *c, d, e:, f: 2, **k, &l) { }\n @b = -> (a, b=1, *c, d:, e:, f: 2, **k, &l) { }\n @c = -> (a=0, b=1, *c, d, e:, f: 2, **k, &l) { }\n @d = -> (a=0, b=1, *c, d:, e:, f: 2, **k, &l) { }"
|
15
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a, b=1, c=2, *d, e, f) { }\n @b = -> (a, b, c=1, *d, e, f, g) { }"
|
16
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a: 1) { }\n @b = -> (a: 1, b: 2) { }"
|
17
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a=1) { }\n @b = -> (a=1, b=2) { }"
|
18
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a=1, *b) { }\n @b = -> (a=1, b=2, *c) { }"
|
19
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a=1, b: 2) { }\n @b = -> (*a, b: 1) { }\n @c = -> (a=1, b: 2) { }\n @d = -> (a=1, *b, c: 2, &l) { }"
|
20
|
-
fails "Proc#arity for instances created with -> () { } returns positive values for definition \n @a = -> ((a, (*b, c))) { }\n @b = -> (a, (*b, c), d, (*e), (*)) { }"
|
21
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition '@a = lambda { |a=1, *b, c:, d: 2, **k, &l| }'"
|
22
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |(a, (*b, c)), d=1| }\n @b = lambda { |a, (*b, c), d, (*e), (*), **k| }\n @c = lambda { |a, (b, c), *, d:, e: 2, **| }"
|
23
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |**k, &l| }\n @b = lambda { |*a, **k| }\n @c = lambda { |a: 1, b: 2, **k| }"
|
24
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |*a, b| }\n @b = lambda { |*a, b, c| }\n @c = lambda { |*a, b, c, d| }"
|
25
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |*| }\n @b = lambda { |*a| }"
|
26
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a, *b, c| }\n @b = lambda { |a, b, *c, d, e| }"
|
27
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a, *| }\n @b = lambda { |a, *b| }\n @c = lambda { |a, b, *c| }\n @d = lambda { |a, b, c, *d| }"
|
28
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a, b=1, *c, d, e:, f: 2, **k, &l| }\n @b = lambda { |a, b=1, *c, d:, e:, f: 2, **k, &l| }\n @c = lambda { |a=0, b=1, *c, d, e:, f: 2, **k, &l| }\n @d = lambda { |a=0, b=1, *c, d:, e:, f: 2, **k, &l| }"
|
29
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a, b=1, c=2, *d, e, f| }\n @b = lambda { |a, b, c=1, *d, e, f, g| }"
|
30
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a, b=1| }\n @b = lambda { |a, b, c=1, d=2| }"
|
31
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a: 1| }\n @b = lambda { |a: 1, b: 2| }"
|
32
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a=1, *b| }\n @b = lambda { |a=1, b=2, *c| }"
|
33
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a=1, b: 2| }\n @b = lambda { |*a, b: 1| }\n @c = lambda { |a=1, b: 2| }\n @d = lambda { |a=1, *b, c: 2, &l| }"
|
34
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a=1| }\n @b = lambda { |a=1, b=2| }"
|
35
5
|
fails "Proc#binding returns a Binding instance"
|
36
6
|
fails "Proc#binding returns the binding associated with self"
|
37
7
|
fails "Proc#call on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError on excess arguments when self is a lambda"
|
@@ -63,20 +33,4 @@ opal_filter "Proc" do
|
|
63
33
|
fails "Proc.new with an associated block returns a new Proc instance from the block passed to the containing method"
|
64
34
|
fails "Proc.new with an associated block returns a subclass of Proc"
|
65
35
|
fails "Proc.new without a block uses the implicit block from an enclosing method"
|
66
|
-
fails "Proc#parameters returns an empty Array for a proc expecting no parameters"
|
67
|
-
fails "Proc#parameters returns an Array of Arrays for a proc expecting parameters"
|
68
|
-
fails "Proc#parameters sets the first element of each sub-Array to :opt for optional arguments"
|
69
|
-
fails "Proc#parameters regards named parameters in procs as optional"
|
70
|
-
fails "Proc#parameters regards optional keyword parameters in procs as optional"
|
71
|
-
fails "Proc#parameters regards parameters with default values as optional"
|
72
|
-
fails "Proc#parameters sets the first element of each sub-Array to :req for required arguments"
|
73
|
-
fails "Proc#parameters regards named parameters in lambdas as required"
|
74
|
-
fails "Proc#parameters regards keyword parameters in lambdas as required"
|
75
|
-
fails "Proc#parameters sets the first element of each sub-Array to :rest for parameters prefixed with asterisks"
|
76
|
-
fails "Proc#parameters sets the first element of each sub-Array to :keyrest for parameters prefixed with double asterisks"
|
77
|
-
fails "Proc#parameters sets the first element of each sub-Array to :block for parameters prefixed with ampersands"
|
78
|
-
fails "Proc#parameters sets the second element of each sub-Array to the name of the argument"
|
79
|
-
fails "Proc#parameters ignores unnamed rest args"
|
80
|
-
fails "Proc#parameters adds nameless rest arg for \"star\" argument"
|
81
|
-
fails "Proc#parameters does not add locals as block options with a block and splat"
|
82
36
|
end
|
data/spec/filters/bugs/regexp.rb
CHANGED
@@ -137,6 +137,7 @@ opal_filter "regular_expressions" do
|
|
137
137
|
fails "Regexp.compile given a String with escaped characters interprets a digit following a three-digit octal value as a character"
|
138
138
|
fails "Regexp.compile given a String with escaped characters interprets a digit following a two-digit hexadecimal value as a character"
|
139
139
|
fails "Regexp.compile given a String with escaped characters raises a Regexp error if there is a trailing backslash"
|
140
|
+
fails "Regexp.compile given a String with escaped characters does not raise a Regexp error if there is an escaped trailing backslash"
|
140
141
|
fails "Regexp.compile given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits"
|
141
142
|
fails "Regexp.compile given a String with escaped characters raises a RegexpError if less than four digits are given for \\uHHHH"
|
142
143
|
fails "Regexp.compile given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given"
|
@@ -4,19 +4,6 @@ opal_filter "UnboundMethod" do
|
|
4
4
|
fails "UnboundMethod#== returns true if objects refer to the same method"
|
5
5
|
fails "UnboundMethod#== returns true if same method is extracted from the same subclass"
|
6
6
|
fails "UnboundMethod#arity for a Method generated by respond_to_missing? returns -1"
|
7
|
-
fails "UnboundMethod#arity returns negative values for method definition 'def m(a=1, *b, c:, d: 2, **k, &l) end'"
|
8
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(*) end\n def n(*a) end"
|
9
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(**k, &l) end\n def n(*a, **k) end\n def o(a: 1, b: 2, **k) end"
|
10
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(*a, b) end\n def n(*a, b, c) end\n def o(*a, b, c, d) end"
|
11
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(a, *) end\n def n(a, *b) end\n def o(a, b, *c) end\n def p(a, b, c, *d) end"
|
12
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(a, *b, c) end\n def n(a, b, *c, d, e) end"
|
13
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(a, b=1) end\n def n(a, b, c=1, d=2) end"
|
14
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(a, b=1, *c, d, e:, f: 2, **k, &l) end\n def n(a, b=1, *c, d:, e:, f: 2, **k, &l) end\n def o(a=0, b=1, *c, d, e:, f: 2, **k, &l) end\n def p(a=0, b=1, *c, d:, e:, f: 2, **k, &l) end"
|
15
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(a, b=1, c=2, *d, e, f) end\n def n(a, b, c=1, *d, e, f, g) end"
|
16
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(a: 1) end\n def n(a: 1, b: 2) end"
|
17
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(a=1) end\n def n(a=1, b=2) end"
|
18
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(a=1, *b) end\n def n(a=1, b=2, *c) end"
|
19
|
-
fails "UnboundMethod#arity returns negative values for method definition \n def m(a=1, b: 2) end\n def n(*a, b: 1) end\n def o(a=1, b: 2) end\n def p(a=1, *b, c: 2, &l) end"
|
20
7
|
fails "UnboundMethod#bind Method returned for obj is equal to one directly returned by obj.method"
|
21
8
|
fails "UnboundMethod#bind raises TypeError if object is not kind_of? the Module the method defined in"
|
22
9
|
fails "UnboundMethod#bind will raise when binding a an object singleton's method to another object"
|
@@ -44,4 +44,9 @@ opal_filter "Bignum" do
|
|
44
44
|
fails "Rational#** when passed Bignum returns Rational(-1) when self is Rational(-1) and the exponent is positive and odd"
|
45
45
|
fails "Rational#** when passed Bignum returns Rational(1) when self is Rational(-1) and the exponent is positive and even"
|
46
46
|
fails "Rational#round with a precision > 0 doesn't fail when rounding to an absurdly large positive precision"
|
47
|
+
fails "Marshal.load loads a Bignum 2**90"
|
48
|
+
fails "Marshal.load for a Integer loads an Integer 2361183241434822606847"
|
49
|
+
fails "Marshal.load for a Integer loads an Integer -2361183241434822606847"
|
50
|
+
fails "Marshal.dump with a Bignum dumps a Bignum"
|
51
|
+
fails "Marshal.dump with a Bignum dumps a Bignum"
|
47
52
|
end
|
@@ -47,4 +47,6 @@ opal_filter "freezing" do
|
|
47
47
|
fails "StringScanner#initialize returns an instance of StringScanner"
|
48
48
|
fails "A singleton method definition raises RuntimeError if frozen"
|
49
49
|
fails "A method definition inside a metaclass scope raises RuntimeError if frozen"
|
50
|
+
fails "Hash literal does not change encoding of literal string keys during creation"
|
51
|
+
fails "Hash literal freezes string keys on initialization"
|
50
52
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
opal_filter "Marshal" do
|
2
|
+
# Marshal.load
|
3
|
+
fails "Marshal.load loads a Random" # depends on the reading from the filesystem
|
4
|
+
fails "Marshal.load when source is tainted returns a tainted object"
|
5
|
+
fails "Marshal.load when source is tainted does not taint Symbols"
|
6
|
+
fails "Marshal.load when source is tainted does not taint Fixnums"
|
7
|
+
fails "Marshal.load when source is tainted does not taint Floats"
|
8
|
+
fails "Marshal.load when source is tainted does not taint Bignums"
|
9
|
+
fails "Marshal.load returns an untainted object if source is untainted"
|
10
|
+
fails "Marshal.load preserves taintedness of nested structure"
|
11
|
+
fails "Marshal.load returns a trusted object if source is trusted"
|
12
|
+
fails "Marshal.load returns an untrusted object if source is untrusted"
|
13
|
+
fails "Marshal.load for a String loads a string through StringIO stream"
|
14
|
+
fails "Marshal.load raises EOFError on loading an empty file"
|
15
|
+
fails "Marshal.load for a String loads a string with an ivar" # depends on string mutation
|
16
|
+
fails "Marshal.load for a String loads a string having ivar with ref to self" # depends on string mutation
|
17
|
+
fails "Marshal.load for a wrapped C pointer loads"
|
18
|
+
fails "Marshal.load for a wrapped C pointer raises TypeError when the local class is missing _load_data"
|
19
|
+
fails "Marshal.load for a wrapped C pointer raises ArgumentError when the local class is a regular object"
|
20
|
+
fails "Marshal.load for an Array loads an array having ivar" # for some reason depends on String#instance_variable_set which is not supported. replaced with test in spec/opal
|
21
|
+
fails "Marshal.load raises a TypeError with bad Marshal version" # depends on String#[]=
|
22
|
+
fails "Marshal.load for a Hash preserves hash ivars when hash contains a string having ivar" # depends on String#instance_variable_set
|
23
|
+
|
24
|
+
# Marshal.dump
|
25
|
+
fails "Marshal.dump returns a tainted string if object is tainted"
|
26
|
+
fails "Marshal.dump returns a tainted string if nested object is tainted"
|
27
|
+
fails "Marshal.dump returns a trusted string if object is trusted"
|
28
|
+
fails "Marshal.dump returns an untrusted string if object is untrusted"
|
29
|
+
fails "Marshal.dump returns an untrusted string if nested object is untrusted"
|
30
|
+
fails "Marshal.dump returns an untainted string if object is untainted"
|
31
|
+
fails "Marshal.dump when passed an IO writes the serialized data to the IO-Object"
|
32
|
+
fails "Marshal.dump when passed an IO returns the IO-Object"
|
33
|
+
fails "Marshal.dump when passed an IO raises an Error when the IO-Object does not respond to #write"
|
34
|
+
fails "Marshal.dump raises a TypeError if dumping a IO/File instance"
|
35
|
+
fails "Marshal.dump with a Regexp dumps a Regexp" # depends on utf-8 encoding which is not required, replaced with test in spec/opal
|
36
|
+
fails "Marshal.dump with a String dumps a String with instance variables" # depends on string mutation
|
37
|
+
fails "Marshal.dump with a Float dumps a Float" # depends on the string mutating, replaced with test in spec/opal
|
38
|
+
fails "Marshal.dump with a Regexp dumps a Regexp with flags" # depends on string encoding, replaced with test in spec/opal
|
39
|
+
fails "Marshal.dump with a Regexp dumps an extended Regexp" # depends on string encoding, replaced with test in spec/opal
|
40
|
+
fails "Marshal.dump with a String dumps a String extended with a Module" # depends on string mutation
|
41
|
+
fails "Marshal.dump dumps subsequent appearances of a symbol as a link" # depends on Symbol-s
|
42
|
+
fails "Marshal.dump with an object responding to #marshal_dump dumps the object returned by #marshal_dump" # depends on Symbol-s, replaced with test in spec/opal
|
43
|
+
fails "Marshal.dump with a Regexp dumps a binary Regexp"
|
44
|
+
fails "Marshal.dump with a Regexp dumps a UTF-8 Regexp"
|
45
|
+
fails "Marshal.dump with a Regexp dumps a Regexp in another encoding"
|
46
|
+
end
|
@@ -11,4 +11,9 @@ opal_filter "Symbol" do
|
|
11
11
|
fails "A Symbol literal can be created by the %s-delimited expression"
|
12
12
|
fails "A Symbol literal can contain null in the string"
|
13
13
|
fails "A Symbol literal can be an empty string"
|
14
|
+
fails "Marshal.dump with a Symbol dumps a Symbol"
|
15
|
+
fails "Marshal.dump with a Symbol dumps a big Symbol"
|
16
|
+
fails "Marshal.dump with a Symbol dumps an encoded Symbol"
|
17
|
+
fails "Marshal.dump with a Symbol dumps a binary encoded Symbol"
|
18
|
+
fails "Marshal.dump with an Array dumps a non-empty Array" # this particular spec dumps a Symbol, spec with String instead of Symbol is in spec/opal/
|
14
19
|
end
|
@@ -30,13 +30,13 @@ describe Opal::Compiler do
|
|
30
30
|
context 'implicit' do
|
31
31
|
let(:method) { 'lambda { defined? super }' }
|
32
32
|
|
33
|
-
it { is_expected.to include "return (!(Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), true, false).$$stub) ? \"super\" : nil)}, TMP_1.$$s = self, TMP_1), $a).call($b)" }
|
33
|
+
it { is_expected.to include "return (!(Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), true, false).$$stub) ? \"super\" : nil)}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b)" }
|
34
34
|
end
|
35
35
|
|
36
36
|
context 'explicit' do
|
37
37
|
let(:method) { 'lambda { defined? super() }' }
|
38
38
|
|
39
|
-
it { is_expected.to include "return (!(Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), true, false).$$stub) ? \"super\" : nil)}, TMP_1.$$s = self, TMP_1), $a).call($b)" }
|
39
|
+
it { is_expected.to include "return (!(Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), true, false).$$stub) ? \"super\" : nil)}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b)" }
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -62,7 +62,7 @@ describe Opal::Compiler do
|
|
62
62
|
is_expected.to include <<-CODE
|
63
63
|
return ($b = ($c = self).$call_method, $b.$$p = (TMP_2 = function(a){var self = TMP_2.$$s || this;
|
64
64
|
if (a == null) a = nil;
|
65
|
-
return self.$foobar()}, TMP_2.$$s = self, TMP_2), $b).apply($c, Opal.to_a(stuff));
|
65
|
+
return self.$foobar()}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).apply($c, Opal.to_a(stuff));
|
66
66
|
CODE
|
67
67
|
end
|
68
68
|
end
|
@@ -84,7 +84,7 @@ if (a == null) a = nil;
|
|
84
84
|
is_expected.to include <<-CODE
|
85
85
|
return ($b = ($c = self).$call_method, $b.$$p = (TMP_2 = function(a){var self = TMP_2.$$s || this;
|
86
86
|
if (a == null) a = nil;
|
87
|
-
return self.$foobar()}, TMP_2.$$s = self, TMP_2), $b).call($c);
|
87
|
+
return self.$foobar()}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).call($c);
|
88
88
|
CODE
|
89
89
|
end
|
90
90
|
end
|
@@ -116,7 +116,7 @@ if (a == null) a = nil;
|
|
116
116
|
is_expected.to include <<-CODE
|
117
117
|
return ($b = ($c = self).$call_method, $b.$$p = (TMP_1 = function(a){var self = TMP_1.$$s || this;
|
118
118
|
if (a == null) a = nil;
|
119
|
-
return self.$foobar()}, TMP_1.$$s = self, TMP_1), $b).apply($c, Opal.to_a(stuff));
|
119
|
+
return self.$foobar()}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $b).apply($c, Opal.to_a(stuff));
|
120
120
|
CODE
|
121
121
|
end
|
122
122
|
end
|
@@ -138,7 +138,7 @@ if (a == null) a = nil;
|
|
138
138
|
is_expected.to include <<-CODE
|
139
139
|
return ($b = ($c = self).$call_method, $b.$$p = (TMP_1 = function(a){var self = TMP_1.$$s || this;
|
140
140
|
if (a == null) a = nil;
|
141
|
-
return self.$foobar()}, TMP_1.$$s = self, TMP_1), $b).call($c);
|
141
|
+
return self.$foobar()}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $b).call($c);
|
142
142
|
CODE
|
143
143
|
end
|
144
144
|
end
|
@@ -179,7 +179,7 @@ if (a == null) a = nil;
|
|
179
179
|
context 'via variable' do
|
180
180
|
let(:invocation) { 'another_method(*args) {|b| foobar }' }
|
181
181
|
|
182
|
-
it { is_expected.to include "return ($a = ($b = self).$another_method, $a.$$p = (TMP_1 = function(b){var self = TMP_1.$$s || this;\nif (b == null) b = nil;\n return self.$foobar()}, TMP_1.$$s = self, TMP_1), $a).apply($b, Opal.to_a(self.$args()));" }
|
182
|
+
it { is_expected.to include "return ($a = ($b = self).$another_method, $a.$$p = (TMP_1 = function(b){var self = TMP_1.$$s || this;\nif (b == null) b = nil;\n return self.$foobar()}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).apply($b, Opal.to_a(self.$args()));" }
|
183
183
|
end
|
184
184
|
|
185
185
|
context 'via reference' do
|
@@ -194,7 +194,7 @@ if (a == null) a = nil;
|
|
194
194
|
context 'via variable' do
|
195
195
|
let(:invocation) { 'another_method {|b| foobar }' }
|
196
196
|
|
197
|
-
it { is_expected.to include "return ($a = ($b = self).$another_method, $a.$$p = (TMP_1 = function(b){var self = TMP_1.$$s || this;\nif (b == null) b = nil;\n return self.$foobar()}, TMP_1.$$s = self, TMP_1), $a).call($b);" }
|
197
|
+
it { is_expected.to include "return ($a = ($b = self).$another_method, $a.$$p = (TMP_1 = function(b){var self = TMP_1.$$s || this;\nif (b == null) b = nil;\n return self.$foobar()}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b);" }
|
198
198
|
end
|
199
199
|
|
200
200
|
context 'via reference' do
|
@@ -270,7 +270,7 @@ if (a == null) a = nil;
|
|
270
270
|
is_expected.to include <<-CODE
|
271
271
|
return ($b = ($c = self, Opal.find_super_dispatcher(self, 'some_method', TMP_1, false)), $b.$$p = (TMP_2 = function(a){var self = TMP_2.$$s || this;
|
272
272
|
if (a == null) a = nil;
|
273
|
-
return self.$foobar()}, TMP_2.$$s = self, TMP_2), $b).apply($c, Opal.to_a(stuff));
|
273
|
+
return self.$foobar()}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).apply($c, Opal.to_a(stuff));
|
274
274
|
CODE
|
275
275
|
end
|
276
276
|
end
|
@@ -292,7 +292,7 @@ if (a == null) a = nil;
|
|
292
292
|
is_expected.to include <<-CODE
|
293
293
|
return ($b = ($c = self, Opal.find_super_dispatcher(self, 'some_method', TMP_1, false)), $b.$$p = (TMP_2 = function(a){var self = TMP_2.$$s || this;
|
294
294
|
if (a == null) a = nil;
|
295
|
-
return self.$foobar()}, TMP_2.$$s = self, TMP_2), $b).apply($c, $zuper);
|
295
|
+
return self.$foobar()}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).apply($c, $zuper);
|
296
296
|
CODE
|
297
297
|
end
|
298
298
|
end
|
@@ -332,7 +332,7 @@ if (a == null) a = nil;
|
|
332
332
|
is_expected.to include <<-CODE
|
333
333
|
return ($b = ($c = self, Opal.find_super_dispatcher(self, 'some_method', TMP_1, false)), $b.$$p = (TMP_2 = function(a){var self = TMP_2.$$s || this;
|
334
334
|
if (a == null) a = nil;
|
335
|
-
return self.$foobar()}, TMP_2.$$s = self, TMP_2), $b).apply($c, Opal.to_a(stuff));
|
335
|
+
return self.$foobar()}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).apply($c, Opal.to_a(stuff));
|
336
336
|
CODE
|
337
337
|
end
|
338
338
|
end
|
@@ -354,7 +354,7 @@ if (a == null) a = nil;
|
|
354
354
|
is_expected.to include <<-CODE
|
355
355
|
return ($b = ($c = self, Opal.find_super_dispatcher(self, 'some_method', TMP_1, false)), $b.$$p = (TMP_2 = function(a){var self = TMP_2.$$s || this;
|
356
356
|
if (a == null) a = nil;
|
357
|
-
return self.$foobar()}, TMP_2.$$s = self, TMP_2), $b).apply($c, $zuper);
|
357
|
+
return self.$foobar()}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).apply($c, $zuper);
|
358
358
|
CODE
|
359
359
|
end
|
360
360
|
end
|
@@ -408,7 +408,7 @@ if (a == null) a = nil;
|
|
408
408
|
is_expected.to include <<-CODE
|
409
409
|
return ($a = ($b = self, Opal.find_super_dispatcher(self, 'regular_method', TMP_1, false)), $a.$$p = (TMP_2 = function(b){var self = TMP_2.$$s || this;
|
410
410
|
if (b == null) b = nil;
|
411
|
-
return self.$foobar()}, TMP_2.$$s = self, TMP_2), $a).apply($b, Opal.to_a(self.$args()));
|
411
|
+
return self.$foobar()}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).apply($b, Opal.to_a(self.$args()));
|
412
412
|
CODE
|
413
413
|
end
|
414
414
|
end
|
@@ -429,7 +429,7 @@ if (b == null) b = nil;
|
|
429
429
|
is_expected.to include <<-CODE
|
430
430
|
return ($a = ($b = self, Opal.find_super_dispatcher(self, 'regular_method', TMP_1, false)), $a.$$p = (TMP_2 = function(b){var self = TMP_2.$$s || this;
|
431
431
|
if (b == null) b = nil;
|
432
|
-
return self.$foobar()}, TMP_2.$$s = self, TMP_2), $a).apply($b, $zuper);
|
432
|
+
return self.$foobar()}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).apply($b, $zuper);
|
433
433
|
CODE
|
434
434
|
end
|
435
435
|
end
|
@@ -452,7 +452,7 @@ if (b == null) b = nil;
|
|
452
452
|
context 'block' do
|
453
453
|
let(:method) { 'stuff = lambda { super }'}
|
454
454
|
|
455
|
-
it { is_expected.to include "return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), false, true)), $c.$$p = $iter, $c).apply($d)}, TMP_1.$$s = self, TMP_1), $a).call($b)" }
|
455
|
+
it { is_expected.to include "return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), false, true)), $c.$$p = $iter, $c).apply($d)}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b)" }
|
456
456
|
end
|
457
457
|
|
458
458
|
context 'block inside method' do
|
@@ -465,7 +465,7 @@ if (b == null) b = nil;
|
|
465
465
|
CODE
|
466
466
|
end
|
467
467
|
|
468
|
-
it { is_expected.to include "return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, 'in_method', (TMP_1.$$def || TMP_2), false, true)), $c.$$p = $iter, $c).apply($d, $zuper)}, TMP_1.$$s = self, TMP_1), $a).call($b);" }
|
468
|
+
it { is_expected.to include "return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, 'in_method', (TMP_1.$$def || TMP_2), false, true)), $c.$$p = $iter, $c).apply($d, $zuper)}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b);" }
|
469
469
|
end
|
470
470
|
|
471
471
|
context 'not first node' do
|
@@ -480,7 +480,7 @@ if (b == null) b = nil;
|
|
480
480
|
CODE
|
481
481
|
end
|
482
482
|
|
483
|
-
it { is_expected.to include "Opal.ret(($c = ($d = self, Opal.find_iter_super_dispatcher(self, 'foo', (TMP_1.$$def || TMP_2), false, true)), $c.$$p = $iter, $c).apply($d, $zuper))}, TMP_1.$$s = self, TMP_1), $a).call($b);" }
|
483
|
+
it { is_expected.to include "Opal.ret(($c = ($d = self, Opal.find_iter_super_dispatcher(self, 'foo', (TMP_1.$$def || TMP_2), false, true)), $c.$$p = $iter, $c).apply($d, $zuper))}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b);" }
|
484
484
|
end
|
485
485
|
|
486
486
|
context 'right method is called, IS THIS A NEW CASE??' do
|
@@ -505,7 +505,7 @@ if (b == null) b = nil;
|
|
505
505
|
end
|
506
506
|
|
507
507
|
# runtime if (current_func.$$def) code should take care of locating the correct method here
|
508
|
-
it { is_expected.to include "return ($d = ($e = self, Opal.find_iter_super_dispatcher(self, 'setup', (
|
508
|
+
it { is_expected.to include "return ($d = ($e = self, Opal.find_iter_super_dispatcher(self, 'setup', (TMP_3.$$def || TMP_4), false, false)), $d.$$p = null, $d).apply($e, Opal.to_a(args))}, TMP_3.$$s = self, TMP_3.$$arity = -1, TMP_3), $a).call($b, \"m\");" }
|
509
509
|
end
|
510
510
|
end
|
511
511
|
|
@@ -521,7 +521,7 @@ if (b == null) b = nil;
|
|
521
521
|
context 'implicit' do
|
522
522
|
let(:invocation) { 'define_method(:wilma) { super }' }
|
523
523
|
|
524
|
-
it { is_expected.to include "return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), false, true)), $c.$$p = $iter, $c).apply($d)}, TMP_1.$$s = self, TMP_1), $a).call($b, \"wilma\")" }
|
524
|
+
it { is_expected.to include "return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), false, true)), $c.$$p = $iter, $c).apply($d)}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b, \"wilma\")" }
|
525
525
|
end
|
526
526
|
|
527
527
|
context 'module' do
|
@@ -537,7 +537,7 @@ if (b == null) b = nil;
|
|
537
537
|
is_expected.to include <<-CODE
|
538
538
|
($a = ($b = self).$define_method, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $c, $d;
|
539
539
|
|
540
|
-
return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), false, false)), $c.$$p = null, $c).call($d)}, TMP_1.$$s = self, TMP_1), $a).call($b, "wilma")
|
540
|
+
return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), false, false)), $c.$$p = null, $c).call($d)}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b, "wilma")
|
541
541
|
CODE
|
542
542
|
end
|
543
543
|
end
|
@@ -554,7 +554,7 @@ if (b == null) b = nil;
|
|
554
554
|
CODE
|
555
555
|
end
|
556
556
|
|
557
|
-
it { is_expected.to include "return ($e = ($f = self, Opal.find_iter_super_dispatcher(self, null, (TMP_2.$$def || TMP_1.$$def || null), false, false)), $e.$$p = null, $e).call($f)}, TMP_2.$$s = self, TMP_2), $c).call($d, \"foo\")}, TMP_1.$$s = self, TMP_1), $a).call($b)" }
|
557
|
+
it { is_expected.to include "return ($e = ($f = self, Opal.find_iter_super_dispatcher(self, null, (TMP_2.$$def || TMP_1.$$def || null), false, false)), $e.$$p = null, $e).call($f)}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $c).call($d, \"foo\")}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b)" }
|
558
558
|
end
|
559
559
|
|
560
560
|
context 'alongside def''d method' do
|
@@ -576,7 +576,7 @@ if (b == null) b = nil;
|
|
576
576
|
CODE
|
577
577
|
end
|
578
578
|
|
579
|
-
it { is_expected.to include "return ($h = ($i = self, Opal.find_iter_super_dispatcher(self, null, (
|
579
|
+
it { is_expected.to include "return ($h = ($i = self, Opal.find_iter_super_dispatcher(self, null, (TMP_6.$$def || TMP_5.$$def || TMP_3.$$def || null), false, false)), $h.$$p = nil.$to_proc(), $h).call($i)}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $f).call($g)}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $d).call($e, \"a\");}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($c, sup);" }
|
580
580
|
end
|
581
581
|
|
582
582
|
context 'alongside another define_method' do
|
@@ -598,7 +598,7 @@ if (b == null) b = nil;
|
|
598
598
|
CODE
|
599
599
|
end
|
600
600
|
|
601
|
-
it { is_expected.to include "return ($i = ($j = self, Opal.find_iter_super_dispatcher(self, null, (
|
601
|
+
it { is_expected.to include "return ($i = ($j = self, Opal.find_iter_super_dispatcher(self, null, (TMP_6.$$def || TMP_5.$$def || TMP_3.$$def || null), false, false)), $i.$$p = nil.$to_proc(), $i).call($j)}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $g).call($h)}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $d).call($f, \"a\");}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($c, sup);" }
|
602
602
|
end
|
603
603
|
|
604
604
|
context 'not last method in class' do
|
@@ -620,7 +620,7 @@ if (b == null) b = nil;
|
|
620
620
|
CODE
|
621
621
|
end
|
622
622
|
|
623
|
-
it { is_expected.to include "return ($h = ($i = self, Opal.find_iter_super_dispatcher(self, null, (
|
623
|
+
it { is_expected.to include "return ($h = ($i = self, Opal.find_iter_super_dispatcher(self, null, (TMP_5.$$def || TMP_4.$$def || TMP_3.$$def || null), false, false)), $h.$$p = nil.$to_proc(), $h).call($i)}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $f).call($g)}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $d).call($e, \"a\");" }
|
624
624
|
end
|
625
625
|
end
|
626
626
|
|
@@ -645,8 +645,8 @@ if (b == null) b = nil;
|
|
645
645
|
CODE
|
646
646
|
end
|
647
647
|
|
648
|
-
it { is_expected.to include "return ($f = ($g = self, Opal.find_iter_super_dispatcher(self, 'foo', (
|
649
|
-
it { is_expected.to include "return ($g = ($h = self, Opal.find_iter_super_dispatcher(self, 'foo', (
|
648
|
+
it { is_expected.to include "return ($f = ($g = self, Opal.find_iter_super_dispatcher(self, 'foo', (TMP_4.$$def || TMP_3.$$def || TMP_5), false, false)), $f.$$p = block2.$to_proc(), $f).call($g, self.$some_arg())}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $d).call($e)}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($c, \"a\");" }
|
649
|
+
it { is_expected.to include "return ($g = ($h = self, Opal.find_iter_super_dispatcher(self, 'foo', (TMP_7.$$def || TMP_6.$$def || TMP_5), false, false)), $g.$$p = nil.$to_proc(), $g).call($h)}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $e).call($f)}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $a).call($d, \"a\")" }
|
650
650
|
end
|
651
651
|
|
652
652
|
context 'explicit' do
|
@@ -656,7 +656,7 @@ if (b == null) b = nil;
|
|
656
656
|
is_expected.to include <<-CODE
|
657
657
|
return ($a = ($b = self).$define_method, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $c, $d;
|
658
658
|
|
659
|
-
return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), false, false)), $c.$$p = null, $c).call($d)}, TMP_1.$$s = self, TMP_1), $a).call($b, "wilma")
|
659
|
+
return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), false, false)), $c.$$p = null, $c).call($d)}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b, "wilma")
|
660
660
|
CODE
|
661
661
|
end
|
662
662
|
end
|
@@ -676,9 +676,9 @@ if (b == null) b = nil;
|
|
676
676
|
CODE
|
677
677
|
end
|
678
678
|
|
679
|
-
it { is_expected.to include "return ($e = ($f = self, Opal.find_iter_super_dispatcher(self, null, (TMP_2.$$def || TMP_1.$$def || null), false, true)), $e.$$p = $iter, $e).apply($f)}, TMP_2.$$s = self, TMP_2), $c).call($d, \"foo\");" }
|
679
|
+
it { is_expected.to include "return ($e = ($f = self, Opal.find_iter_super_dispatcher(self, null, (TMP_2.$$def || TMP_1.$$def || null), false, true)), $e.$$p = $iter, $e).apply($f)}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $c).call($d, \"foo\");" }
|
680
680
|
|
681
|
-
it { is_expected.to include "return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, 'm', (TMP_5.$$def || TMP_6), false, true)), $c.$$p = $iter, $c).apply($d, $zuper)}, TMP_5.$$s = self, TMP_5), $a).call($b);" }
|
681
|
+
it { is_expected.to include "return ($c = ($d = self, Opal.find_iter_super_dispatcher(self, 'm', (TMP_5.$$def || TMP_6), false, true)), $c.$$p = $iter, $c).apply($d, $zuper)}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $a).call($b);" }
|
682
682
|
end
|
683
683
|
end
|
684
684
|
|