You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
da2378d887
Instead of testing arguments.length to see whether an optional parameter was passed to a function, compare its value to "undefined". This approach has two advantages: * It is in line with handling of default parameters in ES6. * Optional parameters are actually spelled out in the parameter list. There is also one important disadvantage, namely that it's impossible to pass "undefined" as an optional parameter value. This required a small change in two tests. Additional notes: * Default parameter values are set in assignments immediately after the function header. This reflects the fact that these assignments really belong to the parameter list (which is where they are in ES6). * Parameter values are checked against "void 0" in places where "undefined" can potentially be redefiend. |
9 years ago | |
---|---|---|
.. | ||
compiler/passes | 9 years ago | |
parser.spec.js | 9 years ago |