Arity checking?
Axel Rauschmayer wrote:
I was under the impression that ECMAScript.next was going to perform arity checking. But looking at the proposals and the draft spec, it doesn’t look like it.
How would that work? It's impossible under 1JS.
I can see pros and cons either way. I take it that the rationale was to not do things too differently(?) It would indeed be weird to perform arity checking only in the presence of parameter default values and/or rest parameters. Conditionally switching it on (e.g. via a pragma) does seem an option, though.
Don't violate 1JS!
Axel Rauschmayer wrote:
I was under the impression that ECMAScript.next was going to perform arity checking. But looking at the proposals and the draft spec, it doesn’t look like it.
How would that work? It's impossible under 1JS.
I can see pros and cons either way. I take it that the rationale was to not do things too differently(?) It would indeed be weird to perform arity checking only in the presence of parameter default values and/or rest parameters. Conditionally switching it on (e.g. via a pragma) does seem an option, though.
Don't violate 1JS!
Yeah. I think I’m getting the hang of this. It is still conceivable to add development-time checks via a library (via a special module loader?).
I was under the impression that ECMAScript.next was going to perform arity checking. But looking at the proposals and the draft spec, it doesn’t look like it.
I can see pros and cons either way. I take it that the rationale was to not do things too differently(?) It would indeed be weird to perform arity checking only in the presence of parameter default values and/or rest parameters. Conditionally switching it on (e.g. via a pragma) does seem an option, though.