From 97c06f2699295e31ac97b4599200ab352b386249 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 10 Nov 2014 00:10:54 +1100 Subject: [PATCH] Revert "Merge branch 'check-lval-paren-expressions' of https://github.com/sebmck/acorn" This reverts commit c8d701914832367e3cc6f570f8da9e6096d26eef, reversing changes made to 0f40710d6a6c846d613764f314e9fb38c247e471. --- acorn.js | 4 -- test/tests-harmony.js | 106 ------------------------------------------ 2 files changed, 110 deletions(-) diff --git a/acorn.js b/acorn.js index 7ed2fc7db6..7ab963e2f0 100644 --- a/acorn.js +++ b/acorn.js @@ -1747,10 +1747,6 @@ } break; - case "ParenthesizedExpression": - toAssignable(node.expression, allowSpread, checkType); - break; - default: if (checkType) unexpected(node.start); } diff --git a/test/tests-harmony.js b/test/tests-harmony.js index 833d229e46..2302f58f60 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -4448,112 +4448,6 @@ test("var {a:b} = {}", { locations: true }); - -test("({ x }) = { x: 5 }", { - type: "Program", - loc: { - start: {line: 1, column: 0}, - end: {line: 1, column: 18} - }, - body: [{ - type: "ExpressionStatement", - loc: { - start: {line: 1, column: 0}, - end: {line: 1, column: 18} - }, - expression: { - type: "AssignmentExpression", - loc: { - start: {line: 1, column: 0}, - end: {line: 1, column: 18} - }, - operator: "=", - left: { - type: "ParenthesizedExpression", - loc: { - start: {line: 1, column: 0}, - end: {line: 1, column: 7} - }, - expression: { - type: "ObjectPattern", - loc: { - start: {line: 1, column: 1}, - end: {line: 1, column: 6} - }, - properties: [ - { - type: "Property", - loc: { - start: {line: 1, column: 3}, - end: {line: 1, column: 4} - }, - method: false, - shorthand: true, - computed: false, - key: { - type: "Identifier", - loc: { - start: {line: 1, column: 3}, - end: {line: 1, column: 4} - }, - name: "x" - }, - kind: "init", - value: { - type: "Identifier", - loc: { - start: {line: 1, column: 3}, - end: {line: 1, column: 4} - }, - name: "x" - } - } - ] - } - }, - right: { - type: "ObjectExpression", - loc: { - start: {line: 1, column: 10}, - end: {line: 1, column: 18} - }, - properties: [{ - type: "Property", - loc: { - start: {line: 1, column: 12}, - end: {line: 1, column: 16} - }, - method: false, - shorthand: false, - computed: false, - key: { - type: "Identifier", - loc: { - start: {line: 1, column: 12}, - end: {line: 1, column: 13} - }, - name: "x" - }, - value: { - type: "Literal", - loc: { - start: {line: 1, column: 15}, - end: {line: 1, column: 16} - }, - value: 5, - raw: "5" - }, - kind: "init" - }] - } - } - }] -}, { - ecmaVersion: 6, - locations: true, - preserveParens: true -}); - // Harmony: Modules test("export var document", {