* lisp/subr.el (function-get): Signal an error if given a non-symbol
for consistency with 'get'.
* test/lisp/subr-tests.el (subr-butlast): Test for the above.
(cherry picked from commit
a4ec9ca12969018cdf15b8cc713b3ba054326f99)
in the hope that it will set PROP. If AUTOLOAD is `macro', do it only
if it's an autoloaded macro."
(declare (important-return-value t))
+ (unless (symbolp f)
+ (signal 'wrong-type-argument (list 'symbolp f)))
(let ((val nil))
(while (and (symbolp f)
(null (setq val (get f prop)))
(should (eq (function-get 'subr-tests--some-fun 'prop) 'value))
;; With an alias.
(should (eq (function-get 'subr-tests--some-alias 'prop) 'value))
- (function-put 'subr-tests--some-alias 'prop 'value))
+ (function-put 'subr-tests--some-alias 'prop 'value)
+ (should-error (function-get "non-symbol" 'prop)
+ :type 'wrong-type-argument)
+ (should-error (function-put "non-symbol" 'prop 'val)
+ :type 'wrong-type-argument))
(function-put 'subr-tests--some-fun 'prop nil)))
(defun subr-tests--butlast-ref (list &optional n)