Throw if set! passed incorrect number of arguments

Description

In the following, the first and last should throw:

Implementation guidance:

The message thrown should be derived from Clojure, perhaps "Malformed assignment, expecting (set! target val) or (set! target -prop val)"

The check and throw can be added to the analyzer's code which parses 'set!:
https://github.com/clojure/clojurescript/blob/6eedd0a08c49f7b0d4dcb30977b2fb38c90577bd/src/main/clojure/cljs/analyzer.cljc#L2229

An example of a similar throw is in the analyzer code for 'if:
https://github.com/clojure/clojurescript/blob/6eedd0a08c49f7b0d4dcb30977b2fb38c90577bd/src/main/clojure/cljs/analyzer.cljc#L1446-L1449

Tests can be added in cljs.analyzer-tests (which is run via lein test): https://github.com/clojure/clojurescript/blob/master/src/test/clojure/cljs/analyzer_tests.clj

Environment

None

Assignee

Robin Schroer

Reporter

Mike Fikes

Labels

Approval

Accepted

Patch

Code and Test

Priority

Major
Configure