mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
add compiler error when building invalid descructure
This commit is contained in:
parent
e2a44b040c
commit
21226eb5e2
@ -103,6 +103,7 @@ extract_assign_names = function(name, accum, prefix)
|
||||
end
|
||||
local build_assign
|
||||
build_assign = function(scope, destruct_literal, receiver)
|
||||
assert(receiver, "attempting to build destructure assign with no receiver")
|
||||
local extracted_names = extract_assign_names(destruct_literal)
|
||||
local names = { }
|
||||
local values = { }
|
||||
|
@ -54,6 +54,8 @@ extract_assign_names = (name, accum={}, prefix={}) ->
|
||||
accum
|
||||
|
||||
build_assign = (scope, destruct_literal, receiver) ->
|
||||
assert receiver, "attempting to build destructure assign with no receiver"
|
||||
|
||||
extracted_names = extract_assign_names destruct_literal
|
||||
|
||||
names = {}
|
||||
|
Loading…
Reference in New Issue
Block a user