Merge pull request #872 from fabiosantoscode/feature/harmony-defaults

Feature/harmony defaults
This commit is contained in:
Richard van Velzen
2016-01-05 21:39:23 +01:00
4 changed files with 76 additions and 10 deletions

View File

@@ -132,6 +132,25 @@ destructuring_arguments: {
}
}
default_arguments: {
input: {
function x(a = 6) { }
function x(a = (6 + 5)) { }
function x({ foo } = {}, [ bar ] = [ 1 ]) { }
}
expect_exact: "function x(a=6){}function x(a=6+5){}function x({foo}={},[bar]=[1]){}"
}
default_values_in_destructurings: {
input: {
function x({a=(4), b}) {}
function x([b, c=(12)]) {}
var { x = (6), y } = x;
var [ x, y = (6) ] = x;
}
expect_exact: "function x({a=4,b}){}function x([b,c=12]){}var{x=6,y}=x;var[x,y=6]=x;"
}
concise_methods: {
input: {
x = {