]> code.delx.au - gnu-emacs-elpa/blobdiff - tests/parser.el
Support object destructuring inside arrow function args
[gnu-emacs-elpa] / tests / parser.el
index 1df960366dde6f0cf616d0d1da9016b073ac8963..ffda856c8471b5fbb3dec96d723c82a6529affd5 100644 (file)
@@ -222,11 +222,14 @@ the test."
 (js2-deftest-parse arrow-function-with-args-and-curlies
   "(a, b = 1, ...c) => {  c;\n};")
 
+(js2-deftest-parse arrow-function-with-destructuring
+  "([{a}, b]) => {  a + b;\n};")
+
 (js2-deftest-parse parenless-arrow-function-prohibits-rest
-  "...b => {b + 1;};" :syntax-error "=>" :errors-count 2)
+  "...b => {b + 1;};" :syntax-error "=>" :errors-count 1)
 
 (js2-deftest-parse parenless-arrow-function-prohibits-destructuring
-  "[a, b] => {a + b;};" :syntax-error "=>" :errors-count 5)
+  "[a, b] => {a + b;};" :syntax-error "=>" :errors-count 4)
 
 ;;; Automatic semicolon insertion