aboutsummaryrefslogtreecommitdiff
path: root/lib/output.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/output.js')
-rw-r--r--lib/output.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/output.js b/lib/output.js
index 3d8d74c9..cd36f74a 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -702,6 +702,8 @@ function OutputStream(options) {
// (false, true) ? (a = 10, b = 20) : (c = 30)
// ==> 20 (side effect, set a := 10 and b := 20)
|| p instanceof AST_Conditional
+ // [ a = (1, 2) ] = [] ==> a == 2
+ || p instanceof AST_DefaultValue
// { [(1, 2)]: 3 }[2] ==> 3
// { foo: (1, 2) }.foo ==> 2
|| p instanceof AST_DestructuredKeyVal
@@ -1218,6 +1220,15 @@ function OutputStream(options) {
}
});
+ DEFPRINT(AST_DefaultValue, function(output) {
+ var self = this;
+ self.name.print(output);
+ output.space();
+ output.print("=");
+ output.space();
+ self.value.print(output);
+ });
+
/* -----[ other expressions ]----- */
function print_call_args(self, output) {
if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) {