removed a redundancy in splatted assignment
This commit is contained in:
parent
5a92b339a4
commit
ecd4722b7c
|
@ -1169,8 +1169,8 @@
|
||||||
};
|
};
|
||||||
Splat.prototype.compileValue = function(o, name, index, trailings) {
|
Splat.prototype.compileValue = function(o, name, index, trailings) {
|
||||||
var trail;
|
var trail;
|
||||||
trail = trailings ? ", " + name + ".length - " + trailings : '';
|
trail = trailings ? ', -' + trailings : '';
|
||||||
return "" + (utility('slice')) + ".call(" + name + ", " + index + trail + ")";
|
return utility('slice') + (".call(" + name + ", " + index + trail + ")");
|
||||||
};
|
};
|
||||||
Splat.compileSplattedArray = function(list, o) {
|
Splat.compileSplattedArray = function(list, o) {
|
||||||
var _len, arg, args, code, end, i, prev;
|
var _len, arg, args, code, end, i, prev;
|
||||||
|
|
|
@ -961,8 +961,8 @@ exports.Splat = class Splat extends Base
|
||||||
# A compiling a splat as a destructuring assignment means slicing arguments
|
# A compiling a splat as a destructuring assignment means slicing arguments
|
||||||
# from the right-hand-side's corresponding array.
|
# from the right-hand-side's corresponding array.
|
||||||
compileValue: (o, name, index, trailings) ->
|
compileValue: (o, name, index, trailings) ->
|
||||||
trail = if trailings then ", #{name}.length - #{trailings}" else ''
|
trail = if trailings then ', -' + trailings else ''
|
||||||
"#{ utility 'slice' }.call(#{name}, #{index}#{trail})"
|
utility('slice') + ".call(#{name}, #{index}#{trail})"
|
||||||
|
|
||||||
# Utility function that converts arbitrary number of elements, mixed with
|
# Utility function that converts arbitrary number of elements, mixed with
|
||||||
# splats, to a proper array
|
# splats, to a proper array
|
||||||
|
|
Loading…
Reference in New Issue