UNPKG

acorn

Version:

ECMAScript parser

2,702 lines (2,670 loc) 495 kB
// Tests largely based on those of Esprima // (http://esprima.org/test/) if (typeof exports != "undefined") { var test = require("./driver.js").test; var testFail = require("./driver.js").testFail; var testAssert = require("./driver.js").testAssert; } test("this\n", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "ThisExpression", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 4 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 4 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 4 } } }); test("null\n", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "Literal", value: null, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 4 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 4 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 4 } } }); test("\n 42\n\n", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "Literal", value: 42, loc: { start: { line: 2, column: 4 }, end: { line: 2, column: 6 } } }, loc: { start: { line: 2, column: 4 }, end: { line: 2, column: 6 } } } ], loc: { start: { line: 2, column: 4 }, end: { line: 2, column: 6 } } }); test("(1 + 2 ) * 3", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "BinaryExpression", left: { type: "BinaryExpression", left: { type: "Literal", value: 1, loc: { start: { line: 1, column: 1 }, end: { line: 1, column: 2 } } }, operator: "+", right: { type: "Literal", value: 2, loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 6 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 8 } } }, operator: "*", right: { type: "Literal", value: 3, loc: { start: { line: 1, column: 11 }, end: { line: 1, column: 12 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 12 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 12 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 12 } } }); test("x = []", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ArrayExpression", elements: [], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 6 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } } }); test("x = [ ]", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ArrayExpression", elements: [], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }); test("x = [ 42 ]", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ArrayExpression", elements: [ { type: "Literal", value: 42, loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 8 } } } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 10 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 10 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 10 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 10 } } }); test("x = [ 42, ]", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ArrayExpression", elements: [ { type: "Literal", value: 42, loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 8 } } } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 11 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 11 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 11 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 11 } } }); test("x = [ ,, 42 ]", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ArrayExpression", elements: [ null, null, { type: "Literal", value: 42, loc: { start: { line: 1, column: 9 }, end: { line: 1, column: 11 } } } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 13 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 13 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 13 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 13 } } }); test("x = [ 1, 2, 3, ]", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ArrayExpression", elements: [ { type: "Literal", value: 1, loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 7 } } }, { type: "Literal", value: 2, loc: { start: { line: 1, column: 9 }, end: { line: 1, column: 10 } } }, { type: "Literal", value: 3, loc: { start: { line: 1, column: 12 }, end: { line: 1, column: 13 } } } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 16 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 16 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 16 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 16 } } }); test("x = [ 1, 2,, 3, ]", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ArrayExpression", elements: [ { type: "Literal", value: 1, loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 7 } } }, { type: "Literal", value: 2, loc: { start: { line: 1, column: 9 }, end: { line: 1, column: 10 } } }, null, { type: "Literal", value: 3, loc: { start: { line: 1, column: 13 }, end: { line: 1, column: 14 } } } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 17 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 17 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 17 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 17 } } }); test("日本語 = []", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "日本語", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 3 } } }, right: { type: "ArrayExpression", elements: [], loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 8 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 8 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 8 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 8 } } }); test("T‿ = []", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "T‿", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 2 } } }, right: { type: "ArrayExpression", elements: [], loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }); test("T‌ = []", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "T‌", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 2 } } }, right: { type: "ArrayExpression", elements: [], loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }); test("T‍ = []", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "T‍", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 2 } } }, right: { type: "ArrayExpression", elements: [], loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }); test("ⅣⅡ = []", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "ⅣⅡ", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 2 } } }, right: { type: "ArrayExpression", elements: [], loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }); test("ⅣⅡ = []", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "ⅣⅡ", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 2 } } }, right: { type: "ArrayExpression", elements: [], loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }); test("x = {}", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 6 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } } }); test("x = { }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 7 } } }); test("x = { answer: 42 }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "answer", loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 12 } } }, value: { type: "Literal", value: 42, loc: { start: { line: 1, column: 14 }, end: { line: 1, column: 16 } } }, kind: "init" } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 18 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 18 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 18 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 18 } } }); test("x = { if: 42 }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "if", loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 8 } } }, value: { type: "Literal", value: 42, loc: { start: { line: 1, column: 10 }, end: { line: 1, column: 12 } } }, kind: "init" } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 14 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 14 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 14 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 14 } } }); test("x = { true: 42 }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "true", loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 10 } } }, value: { type: "Literal", value: 42, loc: { start: { line: 1, column: 12 }, end: { line: 1, column: 14 } } }, kind: "init" } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 16 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 16 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 16 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 16 } } }); test("x = { false: 42 }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "false", loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 11 } } }, value: { type: "Literal", value: 42, loc: { start: { line: 1, column: 13 }, end: { line: 1, column: 15 } } }, kind: "init" } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 17 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 17 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 17 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 17 } } }); test("x = { null: 42 }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "null", loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 10 } } }, value: { type: "Literal", value: 42, loc: { start: { line: 1, column: 12 }, end: { line: 1, column: 14 } } }, kind: "init" } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 16 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 16 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 16 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 16 } } }); test("x = { \"answer\": 42 }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Literal", value: "answer", loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 14 } } }, value: { type: "Literal", value: 42, loc: { start: { line: 1, column: 16 }, end: { line: 1, column: 18 } } }, kind: "init" } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 20 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 20 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 20 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 20 } } }); test("x = { x: 1, x: 2 }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 7 } } }, value: { type: "Literal", value: 1, loc: { start: { line: 1, column: 9 }, end: { line: 1, column: 10 } } }, kind: "init" }, { key: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 12 }, end: { line: 1, column: 13 } } }, value: { type: "Literal", value: 2, loc: { start: { line: 1, column: 15 }, end: { line: 1, column: 16 } } }, kind: "init" } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 18 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 18 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 18 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 18 } } }); test("x = { get width() { return m_width } }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "width", loc: { start: { line: 1, column: 10 }, end: { line: 1, column: 15 } } }, kind: "get", value: { type: "FunctionExpression", id: null, params: [], body: { type: "BlockStatement", body: [ { type: "ReturnStatement", argument: { type: "Identifier", name: "m_width", loc: { start: { line: 1, column: 27 }, end: { line: 1, column: 34 } } }, loc: { start: { line: 1, column: 20 }, end: { line: 1, column: 34 } } } ], loc: { start: { line: 1, column: 18 }, end: { line: 1, column: 36 } } }, loc: { start: { line: 1, column: 15 }, end: { line: 1, column: 36 } } } } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 38 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 38 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 38 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 38 } } }); test("x = { get undef() {} }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "undef", loc: { start: { line: 1, column: 10 }, end: { line: 1, column: 15 } } }, kind: "get", value: { type: "FunctionExpression", id: null, params: [], body: { type: "BlockStatement", body: [], loc: { start: { line: 1, column: 18 }, end: { line: 1, column: 20 } } }, loc: { start: { line: 1, column: 15 }, end: { line: 1, column: 20 } } } } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 22 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 22 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 22 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 22 } } }); test("x = { get if() {} }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "if", loc: { start: { line: 1, column: 10 }, end: { line: 1, column: 12 } } }, kind: "get", value: { type: "FunctionExpression", id: null, params: [], body: { type: "BlockStatement", body: [], loc: { start: { line: 1, column: 15 }, end: { line: 1, column: 17 } } }, loc: { start: { line: 1, column: 12 }, end: { line: 1, column: 17 } } } } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 19 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 19 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 19 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 19 } } }); test("x = { get true() {} }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } }, right: { type: "ObjectExpression", properties: [ { key: { type: "Identifier", name: "true", loc: { start: { line: 1, column: 10 }, end: { line: 1, column: 14 } } }, kind: "get", value: { type: "FunctionExpression", id: null, params: [], body: { type: "BlockStatement", body: [], loc: { start: { line: 1, column: 17 }, end: { line: 1, column: 19 } } }, loc: { start: { line: 1, column: 14 }, end: { line: 1, column: 19 } } } } ], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 21 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 21 } } }, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 21 } } } ], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 21 } } }); test("x = { get false() {} }", { type: "Program", body: [ { type: "ExpressionStatement", expression: { type: "AssignmentExpression", operator: "=", left: { type: "Identifier", name: "x", loc: { start: { line: 1, column