Skip to content

Commit d21cd72

Browse files
committed
explore
1 parent eeeffef commit d21cd72

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

lib/coffeescript/nodes.js

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/nodes.coffee

+11
Original file line numberDiff line numberDiff line change
@@ -2923,7 +2923,18 @@ exports.Splat = class Splat extends Base
29232923
assigns: (name) ->
29242924
@name.assigns name
29252925

2926+
unrollSplat: ->
2927+
return @name unless @name instanceof Obj
2928+
# prop =
2929+
# if @name.properties?[0] instanceof Splat
2930+
# unrollSplat splat
2931+
# lg "2", splat
2932+
# return splat
2933+
2934+
29262935
compileNode: (o) ->
2936+
lg = console.log
2937+
console.log @isAssignable(), @name.unwrapAll()
29272938
[@makeCode('...'), @name.compileToFragments(o, LEVEL_OP)...]
29282939

29292940
unwrap: -> @name

test/assignment.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,8 @@ test "#4673: complex destructured object spread variables", ->
925925
{d.e...} = f: 1
926926
eq d.e.f, 1
927927

928-
# {{g}...} = g: 1
929-
# eq g, 1
928+
{{g}...} = g: 1
929+
eq g, 1
930930

931931
test "#4878: Compile error when using destructuring with a splat or expansion in an array", ->
932932
arr = ['a', 'b', 'c', 'd']

0 commit comments

Comments
 (0)