diff options
author | Nicolas Petton <nicolas@petton.fr> | 2015-04-18 16:35:43 +0200 |
---|---|---|
committer | Nicolas Petton <nicolas@petton.fr> | 2015-04-18 16:35:43 +0200 |
commit | 35c27cd5818bede77279dc7e5cf1beec93766baa (patch) | |
tree | 60311e38c60f099ddd963547336ac49f202c4db8 /lisp/emacs-lisp/map.el | |
parent | c3acb3258df5fc0987fdd233062632ed030923d9 (diff) | |
download | emacs-35c27cd5818bede77279dc7e5cf1beec93766baa.tar.gz |
Throw an error when converting a map into an unknown map type
* lisp/emacs-lisp/map.el (map-into): Throw an error if type is not valid.
* test/automated/map-test.el: Add a regression test.
Diffstat (limited to 'lisp/emacs-lisp/map.el')
-rw-r--r-- | lisp/emacs-lisp/map.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index fec06343f7c..7d839f822d2 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el @@ -193,7 +193,8 @@ MAP can be a list, hash-table or array." TYPE can be one of the following symbols: list or hash-table." (pcase type (`list (map-pairs map)) - (`hash-table (map--into-hash-table map)))) + (`hash-table (map--into-hash-table map)) + (t (error "Not a map type name: %s" type)))) (defmacro map--dispatch (spec &rest args) "Evaluate one of the provided forms depending on the type of MAP. |