Merge pull request #1758 from brandonwillard/fix-decorator-error

Check arguments in with-decorator tag
This commit is contained in:
Kodi Arfer 2019-04-08 14:15:32 -04:00 committed by GitHub
commit cbca711865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,6 +240,8 @@ name (i.e. `sys.argv[0]`).
(deftag @ [expr]
"with-decorator tag macro"
(if (empty? expr)
(macro-error expr "missing function argument"))
(setv decorators (cut expr None -1)
fndef (get expr -1))
`(with-decorator ~@decorators ~fndef))