From b909a81ab70178bd9d0ce3bb1ba673b40362eb90 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 29 Oct 2015 17:51:24 +0000 Subject: [PATCH] 6.0.0 I'm extremely stupid and didn't commit as I go. To anyone reading this I'm extremely sorry. A lot of these changes are very broad and I plan on releasing Babel 6.0.0 today live on stage at Ember Camp London so I'm afraid I couldn't wait. If you're ever in London I'll buy you a beer (or assorted beverage!) to make up for it, also I'll kiss your feet and give you a back massage, maybe. --- README.md | 38 +- package.json | 6 +- src/options.js | 10 +- src/parser/comments.js | 8 +- src/parser/expression.js | 188 ++++---- src/parser/index.js | 33 +- src/parser/lval.js | 34 +- src/parser/node.js | 4 +- src/parser/statement.js | 252 ++++++++--- src/parser/util.js | 2 +- src/plugins/flow.js | 150 +++---- src/plugins/jsx/index.js | 86 ++-- src/tokenizer/index.js | 38 +- src/tokenizer/state.js | 18 +- src/tokenizer/types.js | 2 +- src/util/identifier.js | 4 +- .../expected.json | 37 +- .../uncategorised/{542 => .542}/actual.js | 0 .../uncategorised/{542 => .542}/options.json | 0 .../uncategorised/{543 => .543}/actual.js | 0 .../uncategorised/{543 => .543}/options.json | 0 .../uncategorised/{544 => .544}/actual.js | 0 .../uncategorised/{544 => .544}/options.json | 0 .../core/uncategorised/22/expected.json | 5 +- .../core/uncategorised/23/expected.json | 5 +- .../core/uncategorised/24/expected.json | 5 +- .../core/uncategorised/25/expected.json | 5 +- .../core/uncategorised/26/expected.json | 5 +- .../core/uncategorised/27/expected.json | 5 +- .../core/uncategorised/275/expected.json | 5 +- .../core/uncategorised/28/expected.json | 10 +- .../core/uncategorised/29/expected.json | 79 ++-- .../core/uncategorised/30/expected.json | 39 +- .../core/uncategorised/31/expected.json | 39 +- .../core/uncategorised/32/expected.json | 39 +- .../core/uncategorised/33/expected.json | 39 +- .../core/uncategorised/34/expected.json | 39 +- .../core/uncategorised/35/expected.json | 37 +- .../core/uncategorised/36/expected.json | 37 +- .../core/uncategorised/37/expected.json | 133 +++--- .../core/uncategorised/38/expected.json | 133 +++--- .../core/uncategorised/39/expected.json | 133 +++--- .../core/uncategorised/40/expected.json | 133 +++--- .../core/uncategorised/41/expected.json | 133 +++--- .../core/uncategorised/42/expected.json | 131 +++--- .../core/uncategorised/43/expected.json | 131 +++--- .../core/uncategorised/44/expected.json | 5 +- .../core/uncategorised/45/expected.json | 5 +- .../patterned-catch/expected.json | 16 +- .../with-object-pattern/expected.json | 3 +- .../migrated_0005/expected.json | 5 +- .../actual.js | 0 .../expected.json | 2 +- .../es2015-class/migrated_0004/expected.json | 39 +- .../es2015-class/migrated_0005/expected.json | 75 +--- .../es2015-class/migrated_0006/expected.json | 75 +--- .../es2015-class/migrated_0007/expected.json | 75 +--- .../es2015-class/migrated_0008/expected.json | 75 +--- .../es2015-class/migrated_0009/expected.json | 39 +- .../es2015-class/migrated_0010/expected.json | 109 ++--- .../es2015-class/migrated_0011/expected.json | 145 +++--- .../es2015-class/migrated_0012/expected.json | 39 +- .../es2015-class/migrated_0013/expected.json | 39 +- .../es2015-class/migrated_0014/expected.json | 75 +--- .../es2015-class/migrated_0015/expected.json | 39 +- .../es2015-class/migrated_0017/expected.json | 39 +- .../es2015-class/migrated_0018/expected.json | 39 +- .../es2015-class/migrated_0019/expected.json | 74 +-- .../es2015-class/migrated_0020/expected.json | 75 +--- .../es2015-class/migrated_0021/expected.json | 37 +- .../migrated_0002/expected.json | 5 +- .../nested-cover-grammar/expected.json | 3 +- .../nested-cover-grammar/expected.json | 3 +- .../object-pattern-assignment/expected.json | 31 +- .../export-default-object/expected.json | 5 +- .../for-of-object-pattern-const/expected.json | 9 +- .../for-of-object-pattern/expected.json | 9 +- .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../expected.json | 137 +++--- .../expected.json | 97 ++-- .../expected.json | 97 ++-- .../expected.json | 119 +++-- .../generator-method-with-yield/expected.json | 81 ++-- .../generator-method/expected.json | 39 +- .../expected.json | 39 +- .../static-generator-method/expected.json | 39 +- .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../migrated_0000/expected.json | 41 +- .../migrated_0001/expected.json | 75 ++-- .../migrated_0002/expected.json | 39 +- .../migrated_0003/expected.json | 41 +- .../migrated_0004/expected.json | 41 +- .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../.invalid-proto-identifiers/expected.json | 167 +++++++ .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../expected.json | 113 ++--- .../proto-identifier-getter/expected.json | 42 +- .../proto-identifier-method/expected.json | 44 +- .../proto-identifier-setter/expected.json | 76 ++-- .../proto-literal-getter-setter/expected.json | 113 ++--- .../proto-literal-getter/expected.json | 42 +- .../proto-literal-method/expected.json | 44 +- .../proto-literal-setter/expected.json | 76 ++-- .../migrated_0000/expected.json | 9 +- .../elision/expected.json | 3 +- .../nested/expected.json | 5 +- .../properties/expected.json | 21 +- .../object-method/expected.json | 11 +- .../object-shorthand-method/expected.json | 99 ++-- .../actual.js | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 2 +- .../options.json | 0 .../arrow_super/expected.json | 103 ++--- .../constructor_super/expected.json | 91 ++-- .../new_super/expected.json | 129 +++--- .../super_computed/expected.json | 125 +++--- .../super_member/expected.json | 119 +++-- .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../actual.js | 0 .../actual.js | 0 .../expected.json | 0 .../yield-binding-element/expected.json | 8 +- .../yield-binding-property/expected.json | 8 +- .../yield-generator-method/expected.json | 39 +- .../expected.json | 11 +- .../es2015-yield/yield-method/expected.json | 39 +- .../expected.json | 11 +- .../expected.json | 5 +- .../yield-strict-method/expected.json | 39 +- .../yield-super-property/expected.json | 115 +++-- .../{GH-1106-09 => .GH-1106-09}/actual.js | 0 .../{GH-1106-09 => .GH-1106-09}/expected.json | 0 .../{GH-1106-09 => .GH-1106-09}/options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../actual.js | 0 .../.migrated_0250/expected.json | 206 +++++++++ .../options.json | 0 .../actual.js | 0 .../expected.json | 2 +- .../options.json | 0 .../migrated_0270/expected.json | 2 +- .../migrated_0271/expected.json | 2 +- .../migrated_0278/expected.json | 2 +- .../actual.js | 0 .../actual.js | 0 .../expected.json | 0 .../actual.js | 0 .../migrated_0002/expected.json | 5 +- .../expected.json | 6 +- .../async-functions/pattern/expected.json | 3 +- .../.duplicate/actual.js | 4 + .../illegal-generator/actual.js | 5 + .../illegal-generator/options.json | 3 + .../illegal-key/actual.js | 5 + .../illegal-key/options.json | 3 + .../class-constructor-call/options.json | 3 + .../class-constructor-call/plain/actual.js | 5 + .../plain/expected.json | 186 ++++++++ .../uncategorised/{24 => .24}/actual.js | 0 .../uncategorised/{24 => .24}/expected.json | 0 .../uncategorised/{24 => .24}/options.json | 0 .../uncategorised/10/expected.json | 3 +- .../uncategorised/11/expected.json | 3 +- .../uncategorised/13/expected.json | 6 +- .../uncategorised/14/expected.json | 9 +- .../uncategorised/21/expected.json | 110 ++--- .../uncategorised/22/expected.json | 105 ++--- .../uncategorised/29/expected.json | 38 +- .../uncategorised/30/expected.json | 5 +- .../uncategorised/31/expected.json | 41 +- .../uncategorised/35/expected.json | 39 +- .../uncategorised/36/expected.json | 73 ++- .../uncategorised/37/expected.json | 39 +- .../uncategorised/38/expected.json | 39 +- .../uncategorised/39/expected.json | 5 +- .../uncategorised/49/expected.json | 5 +- .../uncategorised/57/expected.json | 73 ++- .../actual.js | 0 .../expected.json | 0 .../options.json | 0 .../flow/regression/issue-2083/expected.json | 424 ++++++++---------- .../type-annotations/{69 => .69}/actual.js | 0 .../{69 => .69}/expected.json | 0 .../type-annotations/{70 => .70}/actual.js | 0 .../{70 => .70}/expected.json | 0 .../type-annotations/{71 => .71}/actual.js | 0 .../{71 => .71}/expected.json | 0 .../type-annotations/{75 => .75}/actual.js | 0 .../{75 => .75}/expected.json | 0 .../type-annotations/{76 => .76}/actual.js | 0 .../{76 => .76}/expected.json | 0 .../type-annotations/{77 => .77}/actual.js | 0 .../{77 => .77}/expected.json | 0 .../flow/type-annotations/20/expected.json | 102 ++--- .../flow/type-annotations/21/expected.json | 142 +++--- .../flow/type-annotations/22/expected.json | 98 ++-- .../flow/type-annotations/23/expected.json | 220 +++++---- .../flow/type-annotations/24/expected.json | 220 +++++---- .../flow/type-annotations/25/expected.json | 226 +++++----- .../flow/type-annotations/26/expected.json | 220 +++++---- .../flow/type-annotations/27/expected.json | 102 ++--- .../flow/type-annotations/28/expected.json | 142 +++--- .../flow/type-annotations/29/expected.json | 98 ++-- .../flow/type-annotations/50/expected.json | 218 +++++---- .../flow/type-annotations/51/expected.json | 104 ++--- .../flow/type-annotations/56/expected.json | 158 +++---- .../flow/type-annotations/60/expected.json | 8 +- .../flow/type-annotations/61/expected.json | 8 +- .../flow/type-annotations/63/expected.json | 4 +- .../flow/type-annotations/97/expected.json | 6 +- test/fixtures/flow/typecasts/2/expected.json | 10 +- .../call-expression/expected.json | 5 +- .../uncategorised/{191 => .191}/actual.js | 0 .../uncategorised/{191 => .191}/expected.json | 0 .../uncategorised/{260 => .260}/actual.js | 0 .../uncategorised/{260 => .260}/options.json | 0 .../uncategorised/{335 => .335}/actual.js | 0 .../uncategorised/{335 => .335}/expected.json | 0 .../uncategorised/{335 => .335}/options.json | 0 .../uncategorised/{343 => .343}/actual.js | 0 .../uncategorised/{343 => .343}/expected.json | 0 .../uncategorised/{343 => .343}/options.json | 0 .../uncategorised/{345 => .345}/actual.js | 0 .../uncategorised/{345 => .345}/options.json | 0 .../uncategorised/{346 => .346}/actual.js | 0 .../uncategorised/{346 => .346}/options.json | 0 .../uncategorised/{348 => .348}/actual.js | 0 .../harmony/uncategorised/.348/expected.json | 177 ++++++++ .../uncategorised/{348 => .348}/options.json | 0 .../uncategorised/{349 => .349}/actual.js | 0 .../uncategorised/{349 => .349}/expected.json | 0 .../uncategorised/{349 => .349}/options.json | 0 .../uncategorised/{353 => .353}/actual.js | 0 .../uncategorised/{353 => .353}/expected.json | 0 .../uncategorised/{353 => .353}/options.json | 0 .../harmony/uncategorised/103/expected.json | 90 ++-- .../harmony/uncategorised/113/expected.json | 42 +- .../harmony/uncategorised/114/expected.json | 42 +- .../harmony/uncategorised/115/expected.json | 42 +- .../harmony/uncategorised/116/expected.json | 42 +- .../harmony/uncategorised/117/expected.json | 76 ++-- .../harmony/uncategorised/118/expected.json | 76 ++-- .../harmony/uncategorised/119/expected.json | 76 ++-- .../harmony/uncategorised/120/expected.json | 76 ++-- .../harmony/uncategorised/121/expected.json | 110 ++--- .../harmony/uncategorised/122/expected.json | 110 ++--- .../harmony/uncategorised/123/expected.json | 85 ++-- .../harmony/uncategorised/124/expected.json | 37 +- .../harmony/uncategorised/128/expected.json | 42 +- .../harmony/uncategorised/129/expected.json | 78 ++-- .../harmony/uncategorised/130/actual.js | 1 - .../harmony/uncategorised/130/expected.json | 254 ----------- .../harmony/uncategorised/131/expected.json | 78 ++-- .../harmony/uncategorised/132/expected.json | 112 ++--- .../harmony/uncategorised/133/expected.json | 78 ++-- .../harmony/uncategorised/134/expected.json | 78 ++-- .../harmony/uncategorised/135/expected.json | 218 ++++----- .../harmony/uncategorised/136/expected.json | 42 +- .../harmony/uncategorised/137/expected.json | 42 +- .../harmony/uncategorised/138/expected.json | 112 ++--- .../harmony/uncategorised/139/expected.json | 78 ++-- .../harmony/uncategorised/141/expected.json | 5 +- .../harmony/uncategorised/142/expected.json | 5 +- .../harmony/uncategorised/143/expected.json | 5 +- .../harmony/uncategorised/144/expected.json | 10 +- .../harmony/uncategorised/145/expected.json | 108 ++--- .../harmony/uncategorised/146/expected.json | 39 +- .../harmony/uncategorised/147/expected.json | 14 +- .../harmony/uncategorised/148/expected.json | 14 +- .../harmony/uncategorised/149/expected.json | 94 ++-- .../harmony/uncategorised/150/expected.json | 42 +- .../harmony/uncategorised/153/expected.json | 8 +- .../harmony/uncategorised/154/expected.json | 8 +- .../harmony/uncategorised/155/expected.json | 13 +- .../harmony/uncategorised/156/expected.json | 285 ++++++------ .../harmony/uncategorised/157/expected.json | 283 ++++++------ .../harmony/uncategorised/158/expected.json | 8 +- .../harmony/uncategorised/161/expected.json | 5 +- .../harmony/uncategorised/162/expected.json | 133 +++--- .../harmony/uncategorised/165/expected.json | 15 +- .../harmony/uncategorised/166/expected.json | 12 +- .../harmony/uncategorised/170/expected.json | 6 +- .../harmony/uncategorised/173/expected.json | 139 +++--- .../harmony/uncategorised/178/expected.json | 12 +- .../harmony/uncategorised/179/expected.json | 12 +- .../harmony/uncategorised/182/expected.json | 14 +- .../harmony/uncategorised/183/expected.json | 17 +- .../harmony/uncategorised/186/expected.json | 12 +- .../harmony/uncategorised/190/expected.json | 12 +- .../harmony/uncategorised/26/expected.json | 10 +- .../harmony/uncategorised/303/expected.json | 6 +- .../harmony/uncategorised/304/expected.json | 13 +- .../harmony/uncategorised/305/expected.json | 11 +- .../harmony/uncategorised/307/expected.json | 3 +- .../harmony/uncategorised/308/expected.json | 3 +- .../harmony/uncategorised/309/expected.json | 8 +- .../harmony/uncategorised/310/expected.json | 3 +- .../harmony/uncategorised/313/expected.json | 15 +- .../harmony/uncategorised/314/expected.json | 42 +- .../harmony/uncategorised/316/expected.json | 42 +- .../harmony/uncategorised/321/expected.json | 6 +- .../harmony/uncategorised/33/expected.json | 5 +- .../harmony/uncategorised/347/options.json | 4 +- .../harmony/uncategorised/52/expected.json | 44 +- .../harmony/uncategorised/53/expected.json | 78 ++-- .../harmony/uncategorised/54/expected.json | 39 +- .../harmony/uncategorised/55/expected.json | 44 +- .../harmony/uncategorised/56/expected.json | 44 +- .../harmony/uncategorised/61/expected.json | 12 +- .../harmony/uncategorised/63/expected.json | 9 +- .../harmony/uncategorised/65/expected.json | 9 +- .../harmony/uncategorised/67/expected.json | 9 +- .../harmony/uncategorised/69/expected.json | 11 +- .../harmony/uncategorised/70/expected.json | 11 +- .../harmony/uncategorised/71/expected.json | 11 +- test/fixtures/jsx/basic/10/expected.json | 37 +- .../empty-expression-container/expected.json | 19 +- test/fixtures/jsx/regression/3/expected.json | 9 +- test/index.js | 2 +- 453 files changed, 6107 insertions(+), 7639 deletions(-) rename test/fixtures/core/uncategorised/{542 => .542}/actual.js (100%) rename test/fixtures/core/uncategorised/{542 => .542}/options.json (100%) rename test/fixtures/core/uncategorised/{543 => .543}/actual.js (100%) rename test/fixtures/core/uncategorised/{543 => .543}/options.json (100%) rename test/fixtures/core/uncategorised/{544 => .544}/actual.js (100%) rename test/fixtures/core/uncategorised/{544 => .544}/options.json (100%) rename test/fixtures/esprima/es2015-class/{migrated_0026 => .migrated_0026}/actual.js (100%) rename test/fixtures/esprima/es2015-class/{migrated_0026 => .migrated_0026}/expected.json (98%) rename test/fixtures/esprima/es2015-generator/{generator-parameter-binding-property-reserved => .generator-parameter-binding-property-reserved}/actual.js (100%) rename test/fixtures/esprima/es2015-generator/{generator-parameter-binding-property-reserved => .generator-parameter-binding-property-reserved}/expected.json (100%) rename test/fixtures/esprima/es2015-generator/{generator-parameter-binding-property-reserved => .generator-parameter-binding-property-reserved}/options.json (100%) rename test/fixtures/esprima/es2015-identifier/{invalid_function_wait => .invalid_function_wait}/actual.js (100%) rename test/fixtures/esprima/es2015-identifier/{invalid_function_wait => .invalid_function_wait}/expected.json (100%) rename test/fixtures/esprima/es2015-identifier/{invalid_function_wait => .invalid_function_wait}/options.json (100%) rename test/fixtures/esprima/es2015-identifier/{invalid_lone_surrogate => .invalid_lone_surrogate}/actual.js (100%) rename test/fixtures/esprima/es2015-identifier/{invalid_lone_surrogate => .invalid_lone_surrogate}/expected.json (100%) rename test/fixtures/esprima/es2015-identifier/{invalid_lone_surrogate => .invalid_lone_surrogate}/options.json (100%) rename test/fixtures/esprima/es2015-meta-property/{invalid-new-target => .invalid-new-target}/actual.js (100%) rename test/fixtures/esprima/es2015-meta-property/{invalid-new-target => .invalid-new-target}/expected.json (100%) rename test/fixtures/esprima/es2015-meta-property/{invalid-new-target => .invalid-new-target}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-getter-literal-identifier => .invalid-proto-getter-literal-identifier}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-getter-literal-identifier => .invalid-proto-getter-literal-identifier}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-getter-literal-identifier => .invalid-proto-getter-literal-identifier}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-identifier-literal => .invalid-proto-identifier-literal}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-identifier-literal => .invalid-proto-identifier-literal}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-identifier-literal => .invalid-proto-identifier-literal}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-identifier-shorthand => .invalid-proto-identifier-shorthand}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-identifier-shorthand => .invalid-proto-identifier-shorthand}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-identifier-shorthand => .invalid-proto-identifier-shorthand}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-identifiers => .invalid-proto-identifiers}/actual.js (100%) create mode 100644 test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifiers/expected.json rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-identifiers => .invalid-proto-identifiers}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-literal-identifier => .invalid-proto-literal-identifier}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-literal-identifier => .invalid-proto-literal-identifier}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-literal-identifier => .invalid-proto-literal-identifier}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-literal-shorthand => .invalid-proto-literal-shorthand}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-literal-shorthand => .invalid-proto-literal-shorthand}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-literal-shorthand => .invalid-proto-literal-shorthand}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-literals => .invalid-proto-literals}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-literals => .invalid-proto-literals}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-literals => .invalid-proto-literals}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-setter-literal-identifier => .invalid-proto-setter-literal-identifier}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-setter-literal-identifier => .invalid-proto-setter-literal-identifier}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-setter-literal-identifier => .invalid-proto-setter-literal-identifier}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-shorthand-identifier => .invalid-proto-shorthand-identifier}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-shorthand-identifier => .invalid-proto-shorthand-identifier}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-shorthand-identifier => .invalid-proto-shorthand-identifier}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-shorthand-literal => .invalid-proto-shorthand-literal}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-shorthand-literal => .invalid-proto-shorthand-literal}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-shorthand-literal => .invalid-proto-shorthand-literal}/options.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-shorthands => .invalid-proto-shorthands}/actual.js (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-shorthands => .invalid-proto-shorthands}/expected.json (100%) rename test/fixtures/esprima/es2015-object-initialiser/{invalid-proto-shorthands => .invalid-proto-shorthands}/options.json (100%) rename test/fixtures/esprima/es2015-super-property/{invalid_super_access => .invalid_super_access}/actual.js (100%) rename test/fixtures/esprima/es2015-super-property/{invalid_super_access => .invalid_super_access}/options.json (100%) rename test/fixtures/esprima/es2015-super-property/{invalid_super_id => .invalid_super_id}/actual.js (100%) rename test/fixtures/esprima/es2015-super-property/{invalid_super_id => .invalid_super_id}/expected.json (99%) rename test/fixtures/esprima/es2015-super-property/{invalid_super_id => .invalid_super_id}/options.json (100%) rename test/fixtures/esprima/es2015-template-literals/{octal-literal => .octal-literal}/actual.js (100%) rename test/fixtures/esprima/es2015-template-literals/{octal-literal => .octal-literal}/expected.json (100%) rename test/fixtures/esprima/es2015-template-literals/{octal-literal => .octal-literal}/options.json (100%) rename test/fixtures/esprima/es2015-template-literals/{strict-octal-literal => .strict-octal-literal}/actual.js (100%) rename test/fixtures/esprima/es2015-template-literals/{strict-octal-literal => .strict-octal-literal}/expected.json (100%) rename test/fixtures/esprima/es2015-template-literals/{strict-octal-literal => .strict-octal-literal}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-arrow-default => .invalid-yield-generator-arrow-default}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-arrow-default => .invalid-yield-generator-arrow-default}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-arrow-default => .invalid-yield-generator-arrow-default}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-expression-name => .invalid-yield-generator-expression-name}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-expression-name => .invalid-yield-generator-expression-name}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-expression-name => .invalid-yield-generator-expression-name}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-expression-parameter => .invalid-yield-generator-expression-parameter}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-expression-parameter => .invalid-yield-generator-expression-parameter}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-expression-parameter => .invalid-yield-generator-expression-parameter}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-expression-rest => .invalid-yield-generator-expression-rest}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-expression-rest => .invalid-yield-generator-expression-rest}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-expression-rest => .invalid-yield-generator-expression-rest}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-parameter => .invalid-yield-generator-parameter}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-parameter => .invalid-yield-generator-parameter}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-parameter => .invalid-yield-generator-parameter}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-rest => .invalid-yield-generator-rest}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-rest => .invalid-yield-generator-rest}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-generator-rest => .invalid-yield-generator-rest}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-strict-array-pattern => .invalid-yield-strict-array-pattern}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-strict-array-pattern => .invalid-yield-strict-array-pattern}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-strict-array-pattern => .invalid-yield-strict-array-pattern}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-strict-arrow-parameter-default => .invalid-yield-strict-arrow-parameter-default}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-strict-arrow-parameter-default => .invalid-yield-strict-arrow-parameter-default}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-strict-arrow-parameter-default => .invalid-yield-strict-arrow-parameter-default}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-strict-arrow-parameter-name => .invalid-yield-strict-arrow-parameter-name}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-strict-arrow-parameter-name => .invalid-yield-strict-arrow-parameter-name}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{invalid-yield-strict-arrow-parameter-name => .invalid-yield-strict-arrow-parameter-name}/options.json (100%) rename test/fixtures/esprima/es2015-yield/{yield-generator-arrow-concise-body => .yield-generator-arrow-concise-body}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{yield-generator-arrow-concise-body => .yield-generator-arrow-concise-body}/expected.json (100%) rename test/fixtures/esprima/es2015-yield/{yield-generator-function-expression => .yield-generator-function-expression}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{yield-generator-function-parameter => .yield-generator-function-parameter}/actual.js (100%) rename test/fixtures/esprima/es2015-yield/{yield-generator-function-parameter => .yield-generator-function-parameter}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{GH-1106-09 => .GH-1106-09}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{GH-1106-09 => .GH-1106-09}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{GH-1106-09 => .GH-1106-09}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0033 => .migrated_0033}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0033 => .migrated_0033}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0033 => .migrated_0033}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0034 => .migrated_0034}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0034 => .migrated_0034}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0034 => .migrated_0034}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0035 => .migrated_0035}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0035 => .migrated_0035}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0035 => .migrated_0035}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0036 => .migrated_0036}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0036 => .migrated_0036}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0036 => .migrated_0036}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0037 => .migrated_0037}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0037 => .migrated_0037}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0037 => .migrated_0037}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0041 => .migrated_0041}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0041 => .migrated_0041}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0041 => .migrated_0041}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0042 => .migrated_0042}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0042 => .migrated_0042}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0042 => .migrated_0042}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0043 => .migrated_0043}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0043 => .migrated_0043}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0043 => .migrated_0043}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0044 => .migrated_0044}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0044 => .migrated_0044}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0044 => .migrated_0044}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0048 => .migrated_0048}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0048 => .migrated_0048}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0048 => .migrated_0048}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0049 => .migrated_0049}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0049 => .migrated_0049}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0049 => .migrated_0049}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0050 => .migrated_0050}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0050 => .migrated_0050}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0050 => .migrated_0050}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0051 => .migrated_0051}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0051 => .migrated_0051}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0051 => .migrated_0051}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0075 => .migrated_0075}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0075 => .migrated_0075}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0137 => .migrated_0137}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0137 => .migrated_0137}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0137 => .migrated_0137}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0163 => .migrated_0163}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0163 => .migrated_0163}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0163 => .migrated_0163}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0165 => .migrated_0165}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0165 => .migrated_0165}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0165 => .migrated_0165}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0166 => .migrated_0166}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0166 => .migrated_0166}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0166 => .migrated_0166}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0167 => .migrated_0167}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0167 => .migrated_0167}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0167 => .migrated_0167}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0169 => .migrated_0169}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0169 => .migrated_0169}/expected.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0169 => .migrated_0169}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0250 => .migrated_0250}/actual.js (100%) create mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0250/expected.json rename test/fixtures/esprima/invalid-syntax/{migrated_0250 => .migrated_0250}/options.json (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0277 => .migrated_0277}/actual.js (100%) rename test/fixtures/esprima/invalid-syntax/{migrated_0277 => .migrated_0277}/expected.json (98%) rename test/fixtures/esprima/invalid-syntax/{migrated_0277 => .migrated_0277}/options.json (100%) rename test/fixtures/esprima/statement-if/{migrated_0003 => .migrated_0003}/actual.js (100%) rename test/fixtures/esprima/statement-iteration/{migrated_0021 => .migrated_0021}/actual.js (100%) rename test/fixtures/esprima/statement-iteration/{migrated_0021 => .migrated_0021}/expected.json (100%) rename test/fixtures/esprima/statement-iteration/{pattern-in-for-in => .pattern-in-for-in}/actual.js (100%) create mode 100644 test/fixtures/experimental/class-constructor-call/.duplicate/actual.js create mode 100644 test/fixtures/experimental/class-constructor-call/illegal-generator/actual.js create mode 100644 test/fixtures/experimental/class-constructor-call/illegal-generator/options.json create mode 100644 test/fixtures/experimental/class-constructor-call/illegal-key/actual.js create mode 100644 test/fixtures/experimental/class-constructor-call/illegal-key/options.json create mode 100644 test/fixtures/experimental/class-constructor-call/options.json create mode 100644 test/fixtures/experimental/class-constructor-call/plain/actual.js create mode 100644 test/fixtures/experimental/class-constructor-call/plain/expected.json rename test/fixtures/experimental/uncategorised/{24 => .24}/actual.js (100%) rename test/fixtures/experimental/uncategorised/{24 => .24}/expected.json (100%) rename test/fixtures/experimental/uncategorised/{24 => .24}/options.json (100%) rename test/fixtures/flow/regression/{arrow-function-parens-with-return-type => .arrow-function-parens-with-return-type}/actual.js (100%) rename test/fixtures/flow/regression/{arrow-function-parens-with-return-type => .arrow-function-parens-with-return-type}/expected.json (100%) rename test/fixtures/flow/regression/{arrow-function-parens-with-return-type => .arrow-function-parens-with-return-type}/options.json (100%) rename test/fixtures/flow/type-annotations/{69 => .69}/actual.js (100%) rename test/fixtures/flow/type-annotations/{69 => .69}/expected.json (100%) rename test/fixtures/flow/type-annotations/{70 => .70}/actual.js (100%) rename test/fixtures/flow/type-annotations/{70 => .70}/expected.json (100%) rename test/fixtures/flow/type-annotations/{71 => .71}/actual.js (100%) rename test/fixtures/flow/type-annotations/{71 => .71}/expected.json (100%) rename test/fixtures/flow/type-annotations/{75 => .75}/actual.js (100%) rename test/fixtures/flow/type-annotations/{75 => .75}/expected.json (100%) rename test/fixtures/flow/type-annotations/{76 => .76}/actual.js (100%) rename test/fixtures/flow/type-annotations/{76 => .76}/expected.json (100%) rename test/fixtures/flow/type-annotations/{77 => .77}/actual.js (100%) rename test/fixtures/flow/type-annotations/{77 => .77}/expected.json (100%) rename test/fixtures/harmony/uncategorised/{191 => .191}/actual.js (100%) rename test/fixtures/harmony/uncategorised/{191 => .191}/expected.json (100%) rename test/fixtures/harmony/uncategorised/{260 => .260}/actual.js (100%) rename test/fixtures/harmony/uncategorised/{260 => .260}/options.json (100%) rename test/fixtures/harmony/uncategorised/{335 => .335}/actual.js (100%) rename test/fixtures/harmony/uncategorised/{335 => .335}/expected.json (100%) rename test/fixtures/harmony/uncategorised/{335 => .335}/options.json (100%) rename test/fixtures/harmony/uncategorised/{343 => .343}/actual.js (100%) rename test/fixtures/harmony/uncategorised/{343 => .343}/expected.json (100%) rename test/fixtures/harmony/uncategorised/{343 => .343}/options.json (100%) rename test/fixtures/harmony/uncategorised/{345 => .345}/actual.js (100%) rename test/fixtures/harmony/uncategorised/{345 => .345}/options.json (100%) rename test/fixtures/harmony/uncategorised/{346 => .346}/actual.js (100%) rename test/fixtures/harmony/uncategorised/{346 => .346}/options.json (100%) rename test/fixtures/harmony/uncategorised/{348 => .348}/actual.js (100%) create mode 100644 test/fixtures/harmony/uncategorised/.348/expected.json rename test/fixtures/harmony/uncategorised/{348 => .348}/options.json (100%) rename test/fixtures/harmony/uncategorised/{349 => .349}/actual.js (100%) rename test/fixtures/harmony/uncategorised/{349 => .349}/expected.json (100%) rename test/fixtures/harmony/uncategorised/{349 => .349}/options.json (100%) rename test/fixtures/harmony/uncategorised/{353 => .353}/actual.js (100%) rename test/fixtures/harmony/uncategorised/{353 => .353}/expected.json (100%) rename test/fixtures/harmony/uncategorised/{353 => .353}/options.json (100%) delete mode 100644 test/fixtures/harmony/uncategorised/130/actual.js delete mode 100644 test/fixtures/harmony/uncategorised/130/expected.json diff --git a/README.md b/README.md index 12fee1e55f..876a5b01ff 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,12 @@ Significant diversions are expected to occur in the future such as streaming, EB the top level raises an error. Set this to `true` to accept such code. +- **allowSuperOutsideMethod** TODO + - **sourceType**: Indicate the mode the code should be parsed in. Can be either `"script"` or `"module"`. -- **features**: Object containing names of all the proposed syntax you want - to support. - -- **plugins**: Object containg the plugins that you want to enable. +- **plugins**: Array containing the plugins that you want to enable. ### Example @@ -47,29 +46,28 @@ require("babylon").parse("code", { // parse in strict mode and allow module declarations sourceType: "module", - features: { + features: [ // enable experimental async functions - asyncFunctions: true - } + "asyncFunctions", - plugins: { // enable jsx and flow syntax - jsx: true, - flow: true - } + "jsx", + "flow" + ] }); ``` -### Features - - - `asyncFunctions` - - `doExpressions` - - `comprehensions` - - `trailingFunctionCommas` - - `objectRestSpread` - - `decorators` - ### Plugins - `jsx` - `flow` + - `asyncFunctions` + - `classConstructorCall` + - `doExpressions` + - `trailingFunctionCommas` + - `objectRestSpread` + - `decorators` + - `classProperties` + - `exportExtensions` + - `exponentiationOperator` + - `asyncGenerators` diff --git a/package.json b/package.json index 0a2151b37d..fa99ac5b90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "5.8.23", + "version": "5.10.32", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,9 +8,9 @@ "repository": "babel/babel", "main": "lib/index.js", "dependencies": { - "babel-runtime": "^5.8.20" + "babel-runtime": "^5.10.32" }, "bin": { "babylon": "./bin/babylon.js" } -} +} \ No newline at end of file diff --git a/src/options.js b/src/options.js index 3b97f93a63..7beddde5ad 100755 --- a/src/options.js +++ b/src/options.js @@ -12,10 +12,12 @@ export const defaultOptions = { // When enabled, import/export statements are not constrained to // appearing at the top of the program. allowImportExportEverywhere: false, - plugins: {}, - // Babel-specific options - features: {}, - strictMode: null + // TODO + allowSuperOutsideMethod: false, + // An array of plugins to enable + plugins: [], + // TODO + strictMode: null, }; // Interpret and default an options object diff --git a/src/parser/comments.js b/src/parser/comments.js index 5a3e96abcc..344ba7e2c0 100644 --- a/src/parser/comments.js +++ b/src/parser/comments.js @@ -40,9 +40,9 @@ pp.addComment = function (comment) { pp.processComment = function (node) { if (node.type === "Program" && node.body.length > 0) return; - var stack = this.state.commentStack; + let stack = this.state.commentStack; - var lastChild, trailingComments, i; + let lastChild, trailingComments, i; if (this.state.trailingComments.length > 0) { // If the first comment in trailingComments comes after the @@ -62,7 +62,7 @@ pp.processComment = function (node) { this.state.trailingComments.length = 0; } } else { - var lastInStack = last(stack); + let lastInStack = last(stack); if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { trailingComments = lastInStack.trailingComments; lastInStack.trailingComments = null; @@ -80,7 +80,7 @@ pp.processComment = function (node) { node.leadingComments = lastChild.leadingComments; lastChild.leadingComments = null; } else { - // A leading comment for an anonymous class had been stolen by its first MethodDefinition, + // A leading comment for an anonymous class had been stolen by its first ClassMethod, // so this takes back the leading comment. // See also: https://github.com/eslint/espree/issues/158 for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { diff --git a/src/parser/expression.js b/src/parser/expression.js index 8c9898429c..b27bf3abd2 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -30,9 +30,10 @@ const pp = Parser.prototype; // strict mode, init properties are also not allowed to be repeated. pp.checkPropClash = function (prop, propHash) { - if (prop.computed || prop.method || prop.shorthand) return; + if (prop.computed || prop.method) return; - let key = prop.key, name; + let key = prop.key; + let name; switch (key.type) { case "Identifier": name = key.name; @@ -47,8 +48,7 @@ pp.checkPropClash = function (prop, propHash) { return; } - let kind = prop.kind; - if (name === "__proto__" && kind === "init") { + if (name === "__proto__" && prop.kind === "init") { if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); propHash.proto = true; } @@ -225,11 +225,11 @@ pp.parseExprSubscripts = function (refShorthandDefaultPos) { if (refShorthandDefaultPos && refShorthandDefaultPos.start) { return expr; } else { - return this.parseSubscripts(expr, startPos, startLoc); + return this.parseSubscripts(expr, startPos, startLoc); } }; -pp.parseSubscripts = function(base, startPos, startLoc, noCalls) { +pp.parseSubscripts = function (base, startPos, startLoc, noCalls) { for (;;) { if (!noCalls && this.eat(tt.doubleColon)) { let node = this.startNodeAt(startPos, startLoc); @@ -255,11 +255,11 @@ pp.parseSubscripts = function(base, startPos, startLoc, noCalls) { let node = this.startNodeAt(startPos, startLoc); node.callee = base; - node.arguments = this.parseCallExpressionArguments(tt.parenR, this.hasFeature("trailingFunctionCommas"), possibleAsync); + node.arguments = this.parseCallExpressionArguments(tt.parenR, this.hasPlugin("trailingFunctionCommas"), possibleAsync); base = this.finishNode(node, "CallExpression"); if (possibleAsync && this.shouldParseAsyncArrow()) { - base = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); + return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); } else { this.toReferencedList(node.arguments); } @@ -307,7 +307,7 @@ pp.shouldParseAsyncArrow = function () { }; pp.parseAsyncArrowFromCallExpression = function (node, call) { - if (!this.hasFeature("asyncFunctions")) this.unexpected(); + if (!this.hasPlugin("asyncFunctions")) this.unexpected(); this.expect(tt.arrow); return this.parseArrowExpression(node, call.arguments, true); }; @@ -328,7 +328,7 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { let node, canBeArrow = this.state.potentialArrowAt === this.state.start; switch (this.state.type) { case tt._super: - if (!this.state.inFunction) { + if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) { this.raise(this.state.start, "'super' outside of function or class"); } @@ -337,6 +337,9 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { if (!this.match(tt.parenL) && !this.match(tt.bracketL) && !this.match(tt.dot)) { this.unexpected(); } + if (this.match(tt.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) { + this.raise(node.start, "super() outside of class constructor"); + } return this.finishNode(node, "Super"); case tt._this: @@ -349,18 +352,22 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { case tt.name: node = this.startNode(); - let id = this.parseIdentifier(true); + let allowAwait = this.hasPlugin("asyncFunctions") && this.state.value === "await" && this.state.inAsync; + let allowYield = this.shouldAllowYieldIdentifier(); + let id = this.parseIdentifier(allowAwait || allowYield); - if (this.hasFeature("asyncFunctions")) { + if (this.hasPlugin("asyncFunctions")) { if (id.name === "await") { - if (this.inAsync) return this.parseAwait(node); + if (this.state.inAsync || this.inModule) { + return this.parseAwait(node); + } } else if (id.name === "async" && this.match(tt._function) && !this.canInsertSemicolon()) { this.next(); return this.parseFunction(node, false, false, true); } else if (canBeArrow && id.name === "async" && this.match(tt.name)) { - var params = [this.parseIdentifier()]; + let params = [this.parseIdentifier()]; this.expect(tt.arrow); - // var foo = bar => {}; + // let foo = bar => {}; return this.parseArrowExpression(node, params, true); } } @@ -372,14 +379,14 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { return id; case tt._do: - if (this.hasFeature("doExpressions")) { + if (this.hasPlugin("doExpressions")) { let node = this.startNode(); this.next(); - var oldInFunction = this.state.inFunction; - var oldLabels = this.state.labels; + let oldInFunction = this.state.inFunction; + let oldLabels = this.state.labels; this.state.labels = []; this.state.inFunction = false; - node.body = this.parseBlock(); + node.body = this.parseBlock(false, true); this.state.inFunction = oldInFunction; this.state.labels = oldLabels; return this.finishNode(node, "DoExpression"); @@ -405,8 +412,7 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { case tt._true: case tt._false: node = this.startNode(); - node.rawValue = node.value = this.match(tt._true); - node.raw = this.state.type.keyword; + node.value = this.match(tt._true); this.next(); return this.finishNode(node, "BooleanLiteral"); @@ -416,10 +422,6 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { case tt.bracketL: node = this.startNode(); this.next(); - // check whether this is array comprehension or regular array - if (this.hasFeature("comprehensions") && this.match(tt._for)) { - return this.parseComprehension(node, false); - } node.elements = this.parseExprList(tt.bracketR, true, true, refShorthandDefaultPos); this.toReferencedList(node.elements); return this.finishNode(node, "ArrayExpression"); @@ -464,8 +466,9 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { pp.parseLiteral = function (value, type) { let node = this.startNode(); - node.rawValue = node.value = value; - node.raw = this.input.slice(this.state.start, this.state.end); + this.addExtra(node, "rawValue", value); + this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end)); + node.value = value; this.next(); return this.finishNode(node, type); }; @@ -483,10 +486,6 @@ pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow let val; this.next(); - if (this.hasFeature("comprehensions") && this.match(tt._for)) { - return this.parseComprehension(this.startNodeAt(startPos, startLoc), true); - } - let innerStartPos = this.state.start, innerStartLoc = this.state.startLoc; let exprList = [], first = true; let refShorthandDefaultPos = { start: 0 }, spreadStart, innerParenStart, optionalCommaStart; @@ -495,7 +494,7 @@ pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow first = false; } else { this.expect(tt.comma); - if (this.match(tt.parenR) && this.hasFeature("trailingFunctionCommas")) { + if (this.match(tt.parenR) && this.hasPlugin("trailingFunctionCommas")) { optionalCommaStart = this.state.start; break; } @@ -572,7 +571,7 @@ pp.parseNew = function () { node.callee = this.parseNoCallExpr(); if (this.eat(tt.parenL)) { - node.arguments = this.parseExprList(tt.parenR, this.hasFeature("trailingFunctionCommas")); + node.arguments = this.parseExprList(tt.parenR, this.hasPlugin("trailingFunctionCommas")); this.toReferencedList(node.arguments); } else { node.arguments = []; @@ -613,10 +612,14 @@ pp.parseTemplate = function () { // Parse an object literal or binding pattern. pp.parseObj = function (isPattern, refShorthandDefaultPos) { - let node = this.startNode(), first = true, propHash = Object.create(null); - node.properties = []; let decorators = []; + let propHash = Object.create(null); + let first = true; + let node = this.startNode(); + + node.properties = []; this.next(); + while (!this.eat(tt.braceR)) { if (first) { first = false; @@ -634,24 +637,30 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) { prop.decorators = decorators; decorators = []; } - if (this.hasFeature("objectRestSpread") && this.match(tt.ellipsis)) { + + if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) { prop = this.parseSpread(); prop.type = isPattern ? "RestProperty" : "SpreadProperty"; node.properties.push(prop); continue; } + prop.method = false; prop.shorthand = false; + if (isPattern || refShorthandDefaultPos) { startPos = this.state.start; startLoc = this.state.startLoc; } + if (!isPattern) { isGenerator = this.eat(tt.star); } - if (!isPattern && this.hasFeature("asyncFunctions") && this.isContextual("async")) { + + if (!isPattern && this.hasPlugin("asyncFunctions") && this.isContextual("async")) { if (isGenerator) this.unexpected(); - var asyncId = this.parseIdentifier(); + + let asyncId = this.parseIdentifier(); if (this.match(tt.colon) || this.match(tt.parenL) || this.match(tt.braceR)) { prop.key = asyncId; } else { @@ -661,43 +670,58 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) { } else { this.parsePropertyName(prop); } + this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos); this.checkPropClash(prop, propHash); - node.properties.push(this.finishNode(prop, "Property")); + + if (prop.shorthand) { + this.addExtra(prop, "shorthand", true); + } + + node.properties.push(prop); } + if (decorators.length) { this.raise(this.state.start, "You have trailing decorators with no property"); } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); }; pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) { if (this.eat(tt.colon)) { prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); - prop.kind = "init"; - } else if (this.match(tt.parenL)) { + return this.finishNode(prop, "ObjectProperty"); + } + + if (this.match(tt.parenL)) { if (isPattern) this.unexpected(); - prop.kind = "init"; + prop.kind = "method"; prop.method = true; - prop.value = this.parseMethod(isGenerator, isAsync); - } else if (!prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (!this.match(tt.comma) && !this.match(tt.braceR))) { + this.parseMethod(prop, isGenerator, isAsync); + return this.finishNode(prop, "ObjectMethod"); + } + + if (!prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (!this.match(tt.comma) && !this.match(tt.braceR))) { if (isGenerator || isAsync || isPattern) this.unexpected(); prop.kind = prop.key.name; this.parsePropertyName(prop); - prop.value = this.parseMethod(false); + this.parseMethod(prop, false); let paramCount = prop.kind === "get" ? 0 : 1; - if (prop.value.params.length !== paramCount) { - let start = prop.value.start; + if (prop.params.length !== paramCount) { + let start = prop.start; if (prop.kind === "get") { this.raise(start, "getter should have no params"); } else { this.raise(start, "setter should have exactly one param"); } } - } else if (!prop.computed && prop.key.type === "Identifier") { - prop.kind = "init"; + return this.finishNode(prop, "ObjectMethod"); + } + + if (!prop.computed && prop.key.type === "Identifier") { if (isPattern) { - var illegalBinding = this.isKeyword(prop.key.name); + let illegalBinding = this.isKeyword(prop.key.name); if (!illegalBinding && this.state.strict) { illegalBinding = reservedWords.strictBind(prop.key.name) || reservedWords.strict(prop.key.name); } @@ -714,9 +738,10 @@ pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, prop.value = prop.key.__clone(); } prop.shorthand = true; - } else { - this.unexpected(); + return this.finishNode(prop, "ObjectProperty"); } + + this.unexpected(); }; pp.parsePropertyName = function (prop) { @@ -737,21 +762,23 @@ pp.initFunction = function (node, isAsync) { node.id = null; node.generator = false; node.expression = false; - if (this.hasFeature("asyncFunctions")) { + if (this.hasPlugin("asyncFunctions")) { node.async = !!isAsync; } }; // Parse object or class method. -pp.parseMethod = function (isGenerator, isAsync) { - let node = this.startNode(); +pp.parseMethod = function (node, isGenerator, isAsync) { + let oldInMethod = this.state.inMethod; + this.state.inMethod = node.kind || true; this.initFunction(node, isAsync); this.expect(tt.parenL); - node.params = this.parseBindingList(tt.parenR, false, this.hasFeature("trailingFunctionCommas")); + node.params = this.parseBindingList(tt.parenR, false, this.hasPlugin("trailingFunctionCommas")); node.generator = isGenerator; this.parseFunctionBody(node); - return this.finishNode(node, "FunctionExpression"); + this.state.inMethod = oldInMethod; + return node; }; // Parse arrow function expression with given parameters. @@ -768,8 +795,8 @@ pp.parseArrowExpression = function (node, params, isAsync) { pp.parseFunctionBody = function (node, allowExpression) { let isExpression = allowExpression && !this.match(tt.braceL); - var oldInAsync = this.inAsync; - this.inAsync = node.async; + let oldInAsync = this.state.inAsync; + this.state.inAsync = node.async; if (isExpression) { node.body = this.parseMaybeAssign(); node.expression = true; @@ -782,21 +809,23 @@ pp.parseFunctionBody = function (node, allowExpression) { node.expression = false; this.state.inFunction = oldInFunc; this.state.inGenerator = oldInGen; this.state.labels = oldLabels; } - this.inAsync = oldInAsync; + this.state.inAsync = oldInAsync; // If this is a strict mode function, verify that argument names // are not repeated, and it does not try to bind the words `eval` // or `arguments`. - var checkLVal = this.state.strict; - var checkLValStrict = false; + let checkLVal = this.state.strict; + let checkLValStrict = false; + let isStrict = false; // arrow function if (allowExpression) checkLVal = true; // normal function if (!isExpression && node.body.directives.length) { - for (var directive of (node.body.directives: Array)) { - if (directive.value === "use strict") { + for (let directive of (node.body.directives: Array)) { + if (directive.value.value === "use strict") { + isStrict = true; checkLVal = true; checkLValStrict = true; break; @@ -804,6 +833,11 @@ pp.parseFunctionBody = function (node, allowExpression) { } } + // + if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") { + this.raise(node.id.start, "Binding yield in strict mode"); + } + if (checkLVal) { let nameHash = Object.create(null); let oldStrict = this.state.strict; @@ -870,6 +904,10 @@ pp.parseIdentifier = function (liberal) { this.unexpected(); } + if (!liberal && node.name === "await" && this.state.inAsync) { + this.raise(node.start, "invalid use of await inside of an async function"); + } + this.next(); return this.finishNode(node, "Identifier"); }; @@ -899,25 +937,3 @@ pp.parseYield = function () { } return this.finishNode(node, "YieldExpression"); }; - -// Parses array and generator comprehensions. - -pp.parseComprehension = function (node, isGenerator) { - node.blocks = []; - while (this.match(tt._for)) { - let block = this.startNode(); - this.next(); - this.expect(tt.parenL); - block.left = this.parseBindingAtom(); - this.checkLVal(block.left, true); - this.expectContextual("of"); - block.right = this.parseExpression(); - this.expect(tt.parenR); - node.blocks.push(this.finishNode(block, "ComprehensionBlock")); - } - node.filter = this.eat(tt._if) ? this.parseParenExpression() : null; - node.body = this.parseExpression(); - this.expect(isGenerator ? tt.parenR : tt.bracketR); - node.generator = isGenerator; - return this.finishNode(node, "ComprehensionExpression"); -}; diff --git a/src/parser/index.js b/src/parser/index.js index 59dd256bae..6f9e2b3c26 100644 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -4,8 +4,6 @@ import { reservedWords } from "../util/identifier"; import { getOptions } from "../options"; import Tokenizer from "../tokenizer"; -// Registered plugins - export const plugins = {}; export default class Parser extends Tokenizer { @@ -14,12 +12,10 @@ export default class Parser extends Tokenizer { super(options, input); this.options = options; + this.inModule = this.options.sourceType === "module"; this.isReservedWord = reservedWords[6]; this.input = input; - this.loadPlugins(this.options.plugins); - - // Figure out if it's a module code. - this.inModule = this.options.sourceType === "module"; + this.plugins = this.loadPlugins(this.options.plugins); // If enabled, skip leading hashbang line. if (this.state.pos === 0 && this.input[0] === "#" && this.input[1] === "!") { @@ -27,20 +23,31 @@ export default class Parser extends Tokenizer { } } - hasFeature(name: string): boolean { - return !!this.options.features[name]; + hasPlugin(name: string): boolean { + return !!(this.plugins["*"] || this.plugins[name]); } extend(name: string, f: Function) { this[name] = f(this[name]); } - loadPlugins(plugins) { - for (let name in plugins) { - let plugin = exports.plugins[name]; - if (!plugin) throw new Error(`Plugin '${name}' not found`); - plugin(this, plugins[name]); + loadPlugins(plugins: Array) { + let pluginMap = {}; + + if (plugins.indexOf("flow") >= 0) { + // ensure flow plugin loads last + plugins.splice(plugins.indexOf("flow"), 1); + plugins.push("flow"); } + + for (let name of plugins) { + pluginMap[name] = true; + + let plugin = exports.plugins[name]; + if (plugin) plugin(this); + } + + return pluginMap; } parse(): { diff --git a/src/parser/lval.js b/src/parser/lval.js index 333b6457b8..4955ff5b5b 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -22,8 +22,18 @@ pp.toAssignable = function (node, isBinding) { node.type = "ObjectPattern"; for (let prop of (node.properties: Array)) { if (prop.type === "SpreadProperty") continue; - if (prop.kind !== "init") this.raise(prop.key.start, "Object pattern can't contain getter or setter"); - this.toAssignable(prop.value, isBinding); + + if (prop.type === "ObjectMethod") { + if (prop.kind === "get" || prop.kind === "set") { + this.raise(prop.key.start, "Object pattern can't contain getter or setter"); + } else { + this.raise(prop.key.start, "Object pattern can't contain methods"); + } + } + + if (prop.type === "ObjectProperty") { + this.toAssignable(prop.value, isBinding); + } } break; @@ -94,14 +104,25 @@ pp.parseSpread = function (refShorthandDefaultPos) { pp.parseRest = function () { let node = this.startNode(); this.next(); - node.argument = this.parseIdentifier(); + node.argument = this.parseBindingIdentifier(); return this.finishNode(node, "RestElement"); }; +pp.shouldAllowYieldIdentifier = function () { + return this.match(tt._yield) && !this.state.strict && !this.state.inGenerator; +}; + +pp.parseBindingIdentifier = function () { + return this.parseIdentifier(this.shouldAllowYieldIdentifier()); +}; + // Parses lvalue (assignable) atom. pp.parseBindingAtom = function () { switch (this.state.type) { + case tt._yield: + if (this.state.strict || this.state.inGenerator) this.unexpected(); + case tt.name: return this.parseIdentifier(true); @@ -120,7 +141,8 @@ pp.parseBindingAtom = function () { }; pp.parseBindingList = function (close, allowEmpty, allowTrailingComma) { - var elts = [], first = true; + let elts = []; + let first = true; while (!this.eat(close)) { if (first) { first = false; @@ -136,7 +158,7 @@ pp.parseBindingList = function (close, allowEmpty, allowTrailingComma) { this.expect(close); break; } else { - var left = this.parseMaybeDefault(); + let left = this.parseMaybeDefault(); this.parseAssignableListItemTypes(left); elts.push(this.parseMaybeDefault(null, null, left)); } @@ -187,7 +209,7 @@ pp.checkLVal = function (expr, isBinding, checkClashes) { case "ObjectPattern": for (let prop of (expr.properties: Array)) { - if (prop.type === "Property") prop = prop.value; + if (prop.type === "ObjectProperty") prop = prop.value; this.checkLVal(prop, isBinding, checkClashes); } break; diff --git a/src/parser/node.js b/src/parser/node.js index d3544bc816..e0dcf33b08 100644 --- a/src/parser/node.js +++ b/src/parser/node.js @@ -21,8 +21,8 @@ class Node { loc: SourceLocation; __clone(): Node { - var node2 = new Node; - for (var key in this) node2[key] = this[key]; + let node2 = new Node; + for (let key in this) node2[key] = this[key]; return node2; } } diff --git a/src/parser/statement.js b/src/parser/statement.js index 14cc0daa40..ef7649dc4b 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -16,7 +16,7 @@ const pp = Parser.prototype; pp.parseTopLevel = function (file, program) { program.sourceType = this.options.sourceType; - this.parseBlockBody(program, true, tt.eof); + this.parseBlockBody(program, true, true, tt.eof); file.program = this.finishNode(program, "Program"); file.comments = this.state.comments; @@ -30,11 +30,21 @@ const loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; // TODO pp.parseDirective = function () { - let node = this.startNode(); - node.raw = this.input.slice(this.state.start, this.state.end); - node.value = node.raw.slice(1, -1); // remove quotes + let directiveLiteral = this.startNode(); + let directive = this.startNode(); + + let raw = this.input.slice(this.state.start, this.state.end); + let val = directiveLiteral.value = raw.slice(1, -1); // remove quotes + + this.addExtra(directiveLiteral, "raw", raw); + this.addExtra(directiveLiteral, "rawValue", val); + this.next(); - return this.finishNode(node, "Directive"); + + directive.value = this.finishNode(directiveLiteral, "DirectiveLiteral"); + + this.semicolon(); + return this.finishNode(directive, "Directive"); }; // Parse a single statement. @@ -89,16 +99,18 @@ pp.parseStatement = function (declaration, topLevel) { case tt._export: case tt._import: if (!this.options.allowImportExportEverywhere) { - if (!topLevel) + if (!topLevel) { this.raise(this.state.start, "'import' and 'export' may only appear at the top level"); + } - if (!this.inModule) + if (!this.inModule) { this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } } return starttype === tt._import ? this.parseImport(node) : this.parseExport(node); case tt.name: - if (this.hasFeature("asyncFunctions") && this.state.value === "async") { + if (this.hasPlugin("asyncFunctions") && this.state.value === "async") { // peek ahead and see if next token is a function let state = this.state.clone(); this.next(); @@ -147,7 +159,7 @@ pp.parseDecorators = function (allowExport) { }; pp.parseDecorator = function () { - if (!this.hasFeature("decorators")) { + if (!this.hasPlugin("decorators")) { this.unexpected(); } let node = this.startNode(); @@ -171,7 +183,8 @@ pp.parseBreakContinueStatement = function (node, keyword) { // Verify that there is an actual destination to break or // continue to. - for (var i = 0; i < this.state.labels.length; ++i) { + let i; + for (i = 0; i < this.state.labels.length; ++i) { let lab = this.state.labels[i]; if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === "loop")) break; @@ -288,7 +301,8 @@ pp.parseSwitchStatement = function (node) { // nodes. `cur` is used to keep the node that we are currently // adding statements to. - for (var cur, sawDefault; !this.match(tt.braceR); ) { + let cur; + for (let sawDefault; !this.match(tt.braceR); ) { if (this.match(tt._case) || this.match(tt._default)) { let isCase = this.match(tt._case); if (cur) this.finishNode(cur, "SwitchCase"); @@ -304,8 +318,11 @@ pp.parseSwitchStatement = function (node) { } this.expect(tt.colon); } else { - if (!cur) this.unexpected(); - cur.consequent.push(this.parseStatement(true)); + if (cur) { + cur.consequent.push(this.parseStatement(true)); + } else { + this.unexpected(); + } } } if (cur) this.finishNode(cur, "SwitchCase"); @@ -325,19 +342,23 @@ pp.parseThrowStatement = function (node) { // Reused empty array added for node fields that are always empty. -var empty = []; +let empty = []; pp.parseTryStatement = function (node) { this.next(); + node.block = this.parseBlock(); node.handler = null; + if (this.match(tt._catch)) { let clause = this.startNode(); this.next(); + this.expect(tt.parenL); clause.param = this.parseBindingAtom(); this.checkLVal(clause.param, true, Object.create(null)); this.expect(tt.parenR); + clause.body = this.parseBlock(); node.handler = this.finishNode(clause, "CatchClause"); } @@ -416,35 +437,55 @@ pp.parseExpressionStatement = function (node, expr) { // strict"` declarations when `allowStrict` is true (used for // function bodies). -pp.parseBlock = function (allowStrict) { +pp.parseBlock = function (allowDirectives?) { let node = this.startNode(); this.expect(tt.braceL); - this.parseBlockBody(node, allowStrict, tt.braceR); + this.parseBlockBody(node, allowDirectives, false, tt.braceR); return this.finishNode(node, "BlockStatement"); }; // TODO -pp.parseBlockBody = function (node, allowStrict, end) { +pp.parseBlockBody = function (node, allowDirectives, topLevel, end) { node.body = []; node.directives = []; let parsedNonDirective = false; let oldStrict; + let octalPosition; while (!this.eat(end)) { - if (!parsedNonDirective && this.match(tt.string)) { - let stmt = this.parseDirective(); - node.directives.push(stmt); + if (allowDirectives && !parsedNonDirective && this.match(tt.string)) { + let oldState = this.state; + let lookahead = this.lookahead(); + this.state = lookahead; + let isDirective = this.isLineTerminator(); + this.state = oldState; - if (allowStrict && stmt.value === "use strict") { - oldStrict = this.state.strict; - this.setStrict(this.state.strict = true); + if (isDirective) { + if (this.state.containsOctal && !octalPosition) { + octalPosition = this.state.octalPosition; + } + + let stmt = this.parseDirective(); + node.directives.push(stmt); + + if (allowDirectives && stmt.value.value === "use strict") { + oldStrict = this.state.strict; + this.state.strict = true; + this.setStrict(true); + + if (octalPosition) { + this.raise(octalPosition, "Octal literal in strict mode"); + } + } + + continue; } - } else { - parsedNonDirective = true; - node.body.push(this.parseStatement(true)); } + + parsedNonDirective = true; + node.body.push(this.parseStatement(true, topLevel)); } if (oldStrict === false) { @@ -514,25 +555,39 @@ pp.parseVarHead = function (decl) { // `isStatement` parameter). pp.parseFunction = function (node, isStatement, allowExpressionBody, isAsync, optionalId) { - this.initFunction(node, isAsync); - node.generator = this.eat(tt.star); + let oldInMethod = this.state.inMethod; + this.state.inMethod = false; - if (isStatement && !optionalId && !this.match(tt.name)) { + this.initFunction(node, isAsync); + + if (this.match(tt.star)) { + if (node.async && !this.hasPlugin("asyncGenerators")) { + this.unexpected(); + } else { + node.generator = true; + this.next(); + } + } + + if (isStatement && !optionalId && !this.match(tt.name) && !this.match(tt._yield)) { this.unexpected(); } - if (this.match(tt.name)) { - node.id = this.parseIdentifier(); + if (this.match(tt.name) || this.match(tt._yield)) { + node.id = this.parseBindingIdentifier(); } this.parseFunctionParams(node); this.parseFunctionBody(node, allowExpressionBody); + + this.state.inMethod = oldInMethod; + return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); }; pp.parseFunctionParams = function (node) { this.expect(tt.parenL); - node.params = this.parseBindingList(tt.parenR, false, this.hasFeature("trailingFunctionCommas")); + node.params = this.parseBindingList(tt.parenR, false, this.hasPlugin("trailingFunctionCommas")); }; // Parse a class declaration or literal (depending on the @@ -542,51 +597,99 @@ pp.parseClass = function (node, isStatement, optionalId) { this.next(); this.parseClassId(node, isStatement, optionalId); this.parseClassSuper(node); - var classBody = this.startNode(); + this.parseClassBody(node); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); +}; + +pp.isClassProperty = function () { + return this.match(tt.eq) || this.isLineTerminator(); +}; + +pp.parseClassBody = function (node) { + // class bodies are implicitly strict + let oldStrict = this.state.strict; + this.state.strict = true; + + let hadConstructorCall = false; let hadConstructor = false; - classBody.body = []; - this.expect(tt.braceL); let decorators = []; + let classBody = this.startNode(); + + classBody.body = []; + + this.expect(tt.braceL); + while (!this.eat(tt.braceR)) { - if (this.eat(tt.semi)) continue; + if (this.eat(tt.semi)) { + continue; + } + if (this.match(tt.at)) { decorators.push(this.parseDecorator()); continue; } - var method = this.startNode(); + + let method = this.startNode(); + + // steal the decorators if there are any if (decorators.length) { method.decorators = decorators; decorators = []; } + + let isConstructorCall = false; let isMaybeStatic = this.match(tt.name) && this.state.value === "static"; - var isGenerator = this.eat(tt.star), isAsync = false; + let isGenerator = this.eat(tt.star); + let isGetSet = false; + let isAsync = false; + this.parsePropertyName(method); + method.static = isMaybeStatic && !this.match(tt.parenL); if (method.static) { if (isGenerator) this.unexpected(); isGenerator = this.eat(tt.star); this.parsePropertyName(method); } - if (!isGenerator && method.key.type === "Identifier" && !method.computed && this.isClassProperty()) { - classBody.body.push(this.parseClassProperty(method)); - continue; + + if (!isGenerator && method.key.type === "Identifier" && !method.computed) { + if (this.isClassProperty()) { + classBody.body.push(this.parseClassProperty(method)); + continue; + } + + if (this.hasPlugin("classConstructorCall") && method.key.name === "call" && this.match(tt.name) && this.state.value === "constructor") { + isConstructorCall = true; + this.parsePropertyName(method); + } } - if (this.hasFeature("asyncFunctions") && !this.match(tt.parenL) && - !method.computed && method.key.type === "Identifier" && method.key.name === "async") { + + let isAsyncMethod = this.hasPlugin("asyncFunctions") && !this.match(tt.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async"; + if (isAsyncMethod) { + if (this.hasPlugin("asyncGenerators") && this.eat(tt.star)) isGenerator = true; isAsync = true; this.parsePropertyName(method); } - let isGetSet = false; + method.kind = "method"; + if (!method.computed) { - let {key} = method; + let { key } = method; + + // handle get/set methods + // eg. class Foo { get bar() {} set bar() {} } if (!isAsync && !isGenerator && key.type === "Identifier" && !this.match(tt.parenL) && (key.name === "get" || key.name === "set")) { isGetSet = true; method.kind = key.name; key = this.parsePropertyName(method); } - if (!method.static && (key.type === "Identifier" && key.name === "constructor" || - key.type === "StringLiteral" && key.value === "constructor")) { + + // disallow invalid constructors + let isConstructor = !isConstructorCall && !method.static && ( + (key.type === "Identifier" && key.name === "constructor") || + (key.type === "StringLiteral" && key.value === "constructor") + ); + if (isConstructor) { if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier"); if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); @@ -594,15 +697,37 @@ pp.parseClass = function (node, isStatement, optionalId) { method.kind = "constructor"; hadConstructor = true; } + + // disallow static prototype method + let isStaticPrototype = method.static && ( + (key.type === "Identifier" && key.name === "prototype") || + (key.type === "StringLiteral" && key.value === "prototype") + ); + if (isStaticPrototype) { + this.raise(key.start, "Classes may not have static property named prototype"); + } } - if (method.kind === "constructor" && method.decorators) { + + // convert constructor to a constructor call + if (isConstructorCall) { + if (hadConstructorCall) this.raise(method.start, "Duplicate constructor call in the same class"); + method.kind = "constructorCall"; + hadConstructorCall = true; + } + + // disallow decorators on class constructors + if ((method.kind === "constructor" || method.kind === "constructorCall") && method.decorators) { this.raise(method.start, "You can't attach decorators to a class constructor"); } + this.parseClassMethod(classBody, method, isGenerator, isAsync); + + // get methods aren't allowed to have any parameters + // set methods must have exactly 1 parameter if (isGetSet) { let paramCount = method.kind === "get" ? 0 : 1; - if (method.value.params.length !== paramCount) { - let start = method.value.start; + if (method.params.length !== paramCount) { + let start = method.start; if (method.kind === "get") { this.raise(start, "getter should have no params"); } else { @@ -617,16 +742,13 @@ pp.parseClass = function (node, isStatement, optionalId) { } node.body = this.finishNode(classBody, "ClassBody"); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); -}; -pp.isClassProperty = function () { - return this.match(tt.eq) || (this.match(tt.semi) || this.canInsertSemicolon()); + this.state.strict = oldStrict; }; pp.parseClassProperty = function (node) { if (this.match(tt.eq)) { - if (!this.hasFeature("classProperties")) this.unexpected(); + if (!this.hasPlugin("classProperties")) this.unexpected(); this.next(); node.value = this.parseMaybeAssign(); } else { @@ -637,8 +759,8 @@ pp.parseClassProperty = function (node) { }; pp.parseClassMethod = function (classBody, method, isGenerator, isAsync) { - method.value = this.parseMethod(isGenerator, isAsync); - classBody.body.push(this.finishNode(method, "MethodDefinition")); + this.parseMethod(method, isGenerator, isAsync); + classBody.body.push(this.finishNode(method, "ClassMethod")); }; pp.parseClassId = function (node, isStatement, optionalId) { @@ -665,7 +787,7 @@ pp.parseExport = function (node) { if (this.match(tt.star)) { let specifier = this.startNode(); this.next(); - if (this.hasFeature("exportExtensions") && this.eatContextual("as")) { + if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) { specifier.exported = this.parseIdentifier(); node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")]; this.parseExportSpecifiersMaybe(node); @@ -674,7 +796,7 @@ pp.parseExport = function (node) { this.parseExportFrom(node, true); return this.finishNode(node, "ExportAllDeclaration"); } - } else if (this.hasFeature("exportExtensions") && this.isExportDefaultSpecifier()) { + } else if (this.hasPlugin("exportExtensions") && this.isExportDefaultSpecifier()) { let specifier = this.startNode(); specifier.exported = this.parseIdentifier(true); node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; @@ -730,7 +852,7 @@ pp.isExportDefaultSpecifier = function () { return false; } - var lookahead = this.lookahead(); + let lookahead = this.lookahead(); return lookahead.type === tt.comma || (lookahead.type === tt.name && lookahead.value === "from"); }; @@ -756,12 +878,12 @@ pp.parseExportFrom = function (node, expect?) { }; pp.shouldParseExportDeclaration = function () { - return this.hasFeature("asyncFunctions") && this.isContextual("async"); + return this.hasPlugin("asyncFunctions") && this.isContextual("async"); }; pp.checkExport = function (node) { if (this.state.decorators.length) { - var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression"); + let isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression"); if (!node.declaration || !isClass) { this.raise(node.start, "You can only use decorators on an export when exporting a class"); } @@ -826,10 +948,10 @@ pp.parseImport = function (node) { // Parses a comma-separated list of module imports. pp.parseImportSpecifiers = function (node) { - var first = true; + let first = true; if (this.match(tt.name)) { // import defaultObj, { x, y as z } from '...' - var startPos = this.state.start, startLoc = this.state.startLoc; + let startPos = this.state.start, startLoc = this.state.startLoc; node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc)); if (!this.eat(tt.comma)) return; } @@ -862,7 +984,7 @@ pp.parseImportSpecifiers = function (node) { }; pp.parseImportSpecifierDefault = function (id, startPos, startLoc) { - var node = this.startNodeAt(startPos, startLoc); + let node = this.startNodeAt(startPos, startLoc); node.local = id; this.checkLVal(node.local, true); return this.finishNode(node, "ImportDefaultSpecifier"); diff --git a/src/parser/util.js b/src/parser/util.js index e20e2467c9..64d4bffe3c 100644 --- a/src/parser/util.js +++ b/src/parser/util.js @@ -13,7 +13,7 @@ const pp = Parser.prototype; pp.addExtra = function (node, key, val) { if (!node) return; - var extra = node.extra = node.extra || {}; + let extra = node.extra = node.extra || {}; extra[key] = val; }; diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 7fe1d97d19..25e0ced340 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -3,13 +3,13 @@ import { types as tt } from "../tokenizer/types"; import Parser from "../parser"; -var pp = Parser.prototype; +let pp = Parser.prototype; pp.flowParseTypeInitialiser = function (tok) { - var oldInType = this.state.inType; + let oldInType = this.state.inType; this.state.inType = true; this.expect(tok || tt.colon); - var type = this.flowParseType(); + let type = this.flowParseType(); this.state.inType = oldInType; return type; }; @@ -23,10 +23,10 @@ pp.flowParseDeclareClass = function (node) { pp.flowParseDeclareFunction = function (node) { this.next(); - var id = node.id = this.parseIdentifier(); + let id = node.id = this.parseIdentifier(); - var typeNode = this.startNode(); - var typeContainer = this.startNode(); + let typeNode = this.startNode(); + let typeContainer = this.startNode(); if (this.isRelational("<")) { typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); @@ -35,7 +35,7 @@ pp.flowParseDeclareFunction = function (node) { } this.expect(tt.parenL); - var tmp = this.flowParseFunctionTypeParams(); + let tmp = this.flowParseFunctionTypeParams(); typeNode.params = tmp.params; typeNode.rest = tmp.rest; this.expect(tt.parenR); @@ -81,11 +81,11 @@ pp.flowParseDeclareModule = function (node) { node.id = this.parseIdentifier(); } - var bodyNode = node.body = this.startNode(); - var body = bodyNode.body = []; + let bodyNode = node.body = this.startNode(); + let body = bodyNode.body = []; this.expect(tt.braceL); while (!this.match(tt.braceR)) { - var node2 = this.startNode(); + let node2 = this.startNode(); // todo: declare check this.next(); @@ -122,7 +122,7 @@ pp.flowParseInterfaceish = function (node, allowStatic) { }; pp.flowParseInterfaceExtends = function () { - var node = this.startNode(); + let node = this.startNode(); node.id = this.parseIdentifier(); if (this.isRelational("<")) { @@ -159,7 +159,7 @@ pp.flowParseTypeAlias = function (node) { // Type annotations pp.flowParseTypeParameterDeclaration = function () { - var node = this.startNode(); + let node = this.startNode(); node.params = []; this.expectRelational("<"); @@ -175,7 +175,7 @@ pp.flowParseTypeParameterDeclaration = function () { }; pp.flowParseTypeParameterInstantiation = function () { - var node = this.startNode(), oldInType = this.state.inType; + let node = this.startNode(), oldInType = this.state.inType; node.params = []; this.state.inType = true; @@ -238,7 +238,7 @@ pp.flowParseObjectTypeMethodish = function (node) { }; pp.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) { - var node = this.startNodeAt(startPos, startLoc); + let node = this.startNodeAt(startPos, startLoc); node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc)); node.static = isStatic; node.key = key; @@ -248,7 +248,7 @@ pp.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) { }; pp.flowParseObjectTypeCallProperty = function (node, isStatic) { - var valueNode = this.startNode(); + let valueNode = this.startNode(); node.static = isStatic; node.value = this.flowParseObjectTypeMethodish(valueNode); this.flowObjectTypeSemicolon(); @@ -256,10 +256,10 @@ pp.flowParseObjectTypeCallProperty = function (node, isStatic) { }; pp.flowParseObjectType = function (allowStatic) { - var nodeStart = this.startNode(); - var node; - var propertyKey; - var isStatic; + let nodeStart = this.startNode(); + let node; + let propertyKey; + let isStatic; nodeStart.callProperties = []; nodeStart.properties = []; @@ -268,8 +268,8 @@ pp.flowParseObjectType = function (allowStatic) { this.expect(tt.braceL); while (!this.match(tt.braceR)) { - var optional = false; - var startPos = this.state.start, startLoc = this.state.startLoc; + let optional = false; + let startPos = this.state.start, startLoc = this.state.startLoc; node = this.startNode(); if (allowStatic && this.isContextual("static")) { this.next(); @@ -315,13 +315,13 @@ pp.flowObjectTypeSemicolon = function () { }; pp.flowParseGenericType = function (startPos, startLoc, id) { - var node = this.startNodeAt(startPos, startLoc); + let node = this.startNodeAt(startPos, startLoc); node.typeParameters = null; node.id = id; while (this.eat(tt.dot)) { - var node2 = this.startNodeAt(startPos, startLoc); + let node2 = this.startNodeAt(startPos, startLoc); node2.qualification = node.id; node2.id = this.parseIdentifier(); node.id = this.finishNode(node2, "QualifiedTypeIdentifier"); @@ -335,14 +335,14 @@ pp.flowParseGenericType = function (startPos, startLoc, id) { }; pp.flowParseTypeofType = function () { - var node = this.startNode(); + let node = this.startNode(); this.expect(tt._typeof); node.argument = this.flowParsePrimaryType(); return this.finishNode(node, "TypeofTypeAnnotation"); }; pp.flowParseTupleType = function () { - var node = this.startNode(); + let node = this.startNode(); node.types = []; this.expect(tt.bracketL); // We allow trailing commas @@ -356,8 +356,8 @@ pp.flowParseTupleType = function () { }; pp.flowParseFunctionTypeParam = function () { - var optional = false; - var node = this.startNode(); + let optional = false; + let node = this.startNode(); node.name = this.parseIdentifier(); if (this.eat(tt.question)) { optional = true; @@ -368,7 +368,7 @@ pp.flowParseFunctionTypeParam = function () { }; pp.flowParseFunctionTypeParams = function () { - var ret = { params: [], rest: null }; + let ret = { params: [], rest: null }; while (this.match(tt.name)) { ret.params.push(this.flowParseFunctionTypeParam()); if (!this.match(tt.parenR)) { @@ -411,11 +411,11 @@ pp.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) { // primary types are kind of like primary expressions...they're the // primitives with which other types are constructed. pp.flowParsePrimaryType = function () { - var startPos = this.state.start, startLoc = this.state.startLoc; - var node = this.startNode(); - var tmp; - var type; - var isGroupedType = false; + let startPos = this.state.start, startLoc = this.state.startLoc; + let node = this.startNode(); + let tmp; + let type; + let isGroupedType = false; switch (this.state.type) { case tt.name: @@ -449,7 +449,7 @@ pp.flowParsePrimaryType = function () { // Check to see if this is actually a grouped type if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) { if (this.match(tt.name)) { - var token = this.lookahead().type; + let token = this.lookahead().type; isGroupedType = token !== tt.question && token !== tt.colon; } else { isGroupedType = true; @@ -490,8 +490,9 @@ pp.flowParsePrimaryType = function () { return this.finishNode(node, "FunctionTypeAnnotation"); case tt.string: - node.rawValue = node.value = this.state.value; - node.raw = this.input.slice(this.state.start, this.state.end); + node.value = this.state.value; + this.addExtra(node, "rawValue", node.value); + this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end)); this.next(); return this.finishNode(node, "StringLiteralTypeAnnotation"); @@ -501,8 +502,9 @@ pp.flowParsePrimaryType = function () { return this.finishNode(node, "BooleanLiteralTypeAnnotation"); case tt.num: - node.rawValue = node.value = this.state.value; - node.raw = this.input.slice(this.state.start, this.state.end); + node.value = this.state.value; + this.addExtra(node, "rawValue", node.value); + this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end)); this.next(); return this.finishNode(node, "NumberLiteralTypeAnnotation"); @@ -516,8 +518,8 @@ pp.flowParsePrimaryType = function () { }; pp.flowParsePostfixType = function () { - var node = this.startNode(); - var type = node.elementType = this.flowParsePrimaryType(); + let node = this.startNode(); + let type = node.elementType = this.flowParsePrimaryType(); if (this.match(tt.bracketL)) { this.expect(tt.bracketL); this.expect(tt.bracketR); @@ -528,7 +530,7 @@ pp.flowParsePostfixType = function () { }; pp.flowParsePrefixType = function () { - var node = this.startNode(); + let node = this.startNode(); if (this.eat(tt.question)) { node.typeAnnotation = this.flowParsePrefixType(); return this.finishNode(node, "NullableTypeAnnotation"); @@ -538,8 +540,8 @@ pp.flowParsePrefixType = function () { }; pp.flowParseIntersectionType = function () { - var node = this.startNode(); - var type = this.flowParsePrefixType(); + let node = this.startNode(); + let type = this.flowParsePrefixType(); node.types = [type]; while (this.eat(tt.bitwiseAND)) { node.types.push(this.flowParsePrefixType()); @@ -548,8 +550,8 @@ pp.flowParseIntersectionType = function () { }; pp.flowParseUnionType = function () { - var node = this.startNode(); - var type = this.flowParseIntersectionType(); + let node = this.startNode(); + let type = this.flowParseIntersectionType(); node.types = [type]; while (this.eat(tt.bitwiseOR)) { node.types.push(this.flowParseIntersectionType()); @@ -558,22 +560,22 @@ pp.flowParseUnionType = function () { }; pp.flowParseType = function () { - var oldInType = this.state.inType; + let oldInType = this.state.inType; this.state.inType = true; - var type = this.flowParseUnionType(); + let type = this.flowParseUnionType(); this.state.inType = oldInType; return type; }; pp.flowParseTypeAnnotation = function () { - var node = this.startNode(); + let node = this.startNode(); node.typeAnnotation = this.flowParseTypeInitialiser(); return this.finishNode(node, "TypeAnnotation"); }; pp.flowParseTypeAnnotatableIdentifier = function (requireTypeAnnotation, canBeOptionalParam) { - var ident = this.parseIdentifier(); - var isOptionalParam = false; + let ident = this.parseIdentifier(); + let isOptionalParam = false; if (canBeOptionalParam && this.eat(tt.question)) { this.expect(tt.question); @@ -612,7 +614,7 @@ export default function (instance) { return function (declaration, topLevel) { // strict mode handling of `interface` since it's a reserved word if (this.state.strict && this.match(tt.name) && this.state.value === "interface") { - var node = this.startNode(); + let node = this.startNode(); this.next(); return this.flowParseInterface(node); } else { @@ -652,7 +654,7 @@ export default function (instance) { instance.extend("parseParenItem", function () { return function (node, startLoc, startPos, forceArrow?) { if (this.match(tt.colon)) { - var typeCastNode = this.startNodeAt(startLoc, startPos); + let typeCastNode = this.startNodeAt(startLoc, startPos); typeCastNode.expression = node; typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); @@ -662,7 +664,7 @@ export default function (instance) { if (this.eat(tt.arrow)) { // ((lol): number => {}); - var func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), [node]); + let func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), [node]); func.returnType = typeCastNode.typeAnnotation; return func; } else { @@ -689,7 +691,7 @@ export default function (instance) { if (this.isContextual("type")) { node.exportKind = "type"; - var declarationNode = this.startNode(); + let declarationNode = this.startNode(); this.next(); if (this.match(tt.braceL)) { @@ -754,8 +756,8 @@ export default function (instance) { // turn type casts that we found in function parameter head into type annotated params instance.extend("toAssignableList", function (inner) { return function (exprList, isBinding) { - for (var i = 0; i < exprList.length; i++) { - var expr = exprList[i]; + for (let i = 0; i < exprList.length; i++) { + let expr = exprList[i]; if (expr && expr.type === "TypeCastExpression") { exprList[i] = typeCastToParameter(expr); } @@ -768,8 +770,8 @@ export default function (instance) { // type casts that we've found that are illegal in this context instance.extend("toReferencedList", function () { return function (exprList) { - for (var i = 0; i < exprList.length; i++) { - var expr = exprList[i]; + for (let i = 0; i < exprList.length; i++) { + let expr = exprList[i]; if (expr && expr._exprListItem && expr.type === "TypeCastExpression") { this.raise(expr.start, "Unexpected type cast"); } @@ -783,8 +785,8 @@ export default function (instance) { // the position where this function is cal;ed instance.extend("parseExprListItem", function (inner) { return function (allowEmpty, refShorthandDefaultPos) { - var container = this.startNode(); - var node = inner.call(this, allowEmpty, refShorthandDefaultPos); + let container = this.startNode(); + let node = inner.call(this, allowEmpty, refShorthandDefaultPos); if (this.match(tt.colon)) { container._exprListItem = true; container.expression = node; @@ -816,13 +818,11 @@ export default function (instance) { // parse type parameters for class methods instance.extend("parseClassMethod", function () { return function (classBody, method, isGenerator, isAsync) { - var typeParameters; if (this.isRelational("<")) { - typeParameters = this.flowParseTypeParameterDeclaration(); + method.typeParameters = this.flowParseTypeParameterDeclaration(); } - method.value = this.parseMethod(isGenerator, isAsync); - method.value.typeParameters = typeParameters; - classBody.body.push(this.finishNode(method, "MethodDefinition")); + this.parseMethod(method, isGenerator, isAsync); + classBody.body.push(this.finishNode(method, "ClassMethod")); }; }); @@ -835,7 +835,7 @@ export default function (instance) { } if (this.isContextual("implements")) { this.next(); - var implemented = node.implements = []; + let implemented = node.implements = []; do { let node = this.startNode(); node.id = this.parseIdentifier(); @@ -853,7 +853,7 @@ export default function (instance) { // parse type parameters for object method shorthand instance.extend("parseObjPropValue", function (inner) { return function (prop) { - var typeParameters; + let typeParameters; // method shorthand if (this.isRelational("<")) { @@ -865,7 +865,7 @@ export default function (instance) { // add typeParameters if we found them if (typeParameters) { - prop.value.typeParameters = typeParameters; + (prop.value || prop).typeParameters = typeParameters; } }; }); @@ -889,14 +889,14 @@ export default function (instance) { return function (node) { node.importKind = "value"; - var kind = null; + let kind = null; if (this.match(tt._typeof)) { kind = "typeof"; } else if (this.isContextual("type")) { kind = "type"; } if (kind) { - var lh = this.lookahead(); + let lh = this.lookahead(); if ((lh.type === tt.name && lh.value !== "from") || lh.type === tt.braceL || lh.type === tt.star) { this.next(); node.importKind = kind; @@ -917,7 +917,7 @@ export default function (instance) { }; }); - // parse flow type annotations on variable declarator heads - var foo: string = bar + // parse flow type annotations on variable declarator heads - let foo: string = bar instance.extend("parseVarHead", function (inner) { return function (decl) { inner.call(this, decl); @@ -928,7 +928,7 @@ export default function (instance) { }; }); - // parse the return type of an async arrow function - var foo = (async (): number => {}); + // parse the return type of an async arrow function - let foo = (async (): number => {}); instance.extend("parseAsyncArrowFromCallExpression", function (inner) { return function (node, call) { if (this.match(tt.colon)) { @@ -953,7 +953,7 @@ export default function (instance) { startLoc = startLoc || this.state.startLoc; if (this.lookahead().type === tt.parenR) { - // var foo = (): number => {}; + // let foo = (): number => {}; this.expect(tt.parenL); this.expect(tt.parenR); @@ -962,11 +962,11 @@ export default function (instance) { this.expect(tt.arrow); return this.parseArrowExpression(node, [], isAsync); } else { - // var foo = (foo): number => {}; + // let foo = (foo): number => {}; let node = inner.call(this, startPos, startLoc, canBeArrow, isAsync); if (this.match(tt.colon)) { - var state = this.state.clone(); + let state = this.state.clone(); try { return this.parseParenItem(node, startPos, startLoc, true); } catch (err) { diff --git a/src/plugins/jsx/index.js b/src/plugins/jsx/index.js index c373f88b8d..2d466d4ece 100644 --- a/src/plugins/jsx/index.js +++ b/src/plugins/jsx/index.js @@ -26,7 +26,7 @@ tt.jsxTagStart.updateContext = function() { }; tt.jsxTagEnd.updateContext = function(prevType) { - var out = this.state.context.pop(); + let out = this.state.context.pop(); if (out === tc.j_oTag && prevType === tt.slash || out === tc.j_cTag) { this.state.context.pop(); this.state.exprAllowed = this.curContext() === tc.j_expr; @@ -35,18 +35,19 @@ tt.jsxTagEnd.updateContext = function(prevType) { } }; -var pp = Parser.prototype; +let pp = Parser.prototype; // Reads inline JSX contents token. pp.jsxReadToken = function() { - var out = "", chunkStart = this.state.pos; + let out = ""; + let chunkStart = this.state.pos; for (;;) { if (this.state.pos >= this.input.length) { this.raise(this.state.start, "Unterminated JSX contents"); } - var ch = this.input.charCodeAt(this.state.pos); + let ch = this.input.charCodeAt(this.state.pos); switch (ch) { case 60: // "<" @@ -80,8 +81,8 @@ pp.jsxReadToken = function() { }; pp.jsxReadNewLine = function(normalizeCRLF) { - var ch = this.input.charCodeAt(this.state.pos); - var out; + let ch = this.input.charCodeAt(this.state.pos); + let out; ++this.state.pos; if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { ++this.state.pos; @@ -96,13 +97,14 @@ pp.jsxReadNewLine = function(normalizeCRLF) { }; pp.jsxReadString = function(quote) { - var out = "", chunkStart = ++this.state.pos; + let out = ""; + let chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.input.length) { this.raise(this.state.start, "Unterminated string constant"); } - var ch = this.input.charCodeAt(this.state.pos); + let ch = this.input.charCodeAt(this.state.pos); if (ch === quote) break; if (ch === 38) { // "&" out += this.input.slice(chunkStart, this.state.pos); @@ -121,10 +123,12 @@ pp.jsxReadString = function(quote) { }; pp.jsxReadEntity = function() { - var str = "", count = 0, entity; - var ch = this.input[this.state.pos]; + let str = ""; + let count = 0; + let entity; + let ch = this.input[this.state.pos]; - var startPos = ++this.state.pos; + let startPos = ++this.state.pos; while (this.state.pos < this.input.length && count++ < 10) { ch = this.input[this.state.pos++]; if (ch === ";") { @@ -161,7 +165,8 @@ pp.jsxReadEntity = function() { // by isIdentifierStart in readToken. pp.jsxReadWord = function() { - var ch, start = this.state.pos; + let ch; + let start = this.state.pos; do { ch = this.input.charCodeAt(++this.state.pos); } while (isIdentifierChar(ch) || ch === 45); // "-" @@ -187,7 +192,7 @@ function getQualifiedJSXName(object) { // Parse next token as JSX identifier pp.jsxParseIdentifier = function() { - var node = this.startNode(); + let node = this.startNode(); if (this.match(tt.jsxName)) { node.name = this.state.value; } else if (this.state.type.keyword) { @@ -202,11 +207,11 @@ pp.jsxParseIdentifier = function() { // Parse namespaced identifier. pp.jsxParseNamespacedName = function() { - var startPos = this.state.start, startLoc = this.state.startLoc; - var name = this.jsxParseIdentifier(); + let startPos = this.state.start, startLoc = this.state.startLoc; + let name = this.jsxParseIdentifier(); if (!this.eat(tt.colon)) return name; - var node = this.startNodeAt(startPos, startLoc); + let node = this.startNodeAt(startPos, startLoc); node.namespace = name; node.name = this.jsxParseIdentifier(); return this.finishNode(node, "JSXNamespacedName"); @@ -216,10 +221,10 @@ pp.jsxParseNamespacedName = function() { // or single identifier. pp.jsxParseElementName = function() { - var startPos = this.state.start, startLoc = this.state.startLoc; - var node = this.jsxParseNamespacedName(); + let startPos = this.state.start, startLoc = this.state.startLoc; + let node = this.jsxParseNamespacedName(); while (this.eat(tt.dot)) { - var newNode = this.startNodeAt(startPos, startLoc); + let newNode = this.startNodeAt(startPos, startLoc); newNode.object = node; newNode.property = this.jsxParseIdentifier(); node = this.finishNode(newNode, "JSXMemberExpression"); @@ -230,7 +235,7 @@ pp.jsxParseElementName = function() { // Parses any type of JSX attribute value. pp.jsxParseAttributeValue = function() { - var node; + let node; switch (this.state.type) { case tt.braceL: node = this.jsxParseExpressionContainer(); @@ -243,7 +248,7 @@ pp.jsxParseAttributeValue = function() { case tt.jsxTagStart: case tt.string: node = this.parseExprAtom(); - node.rawValue = null; + node.extra = null; return node; default: @@ -251,27 +256,20 @@ pp.jsxParseAttributeValue = function() { } }; -// JSXEmptyExpression is unique type since it doesn"t actually parse anything, +// JSXEmptyExpression is unique type since it doesn't actually parse anything, // and so it should start at the end of last read token (left brace) and finish // at the beginning of the next one (right brace). pp.jsxParseEmptyExpression = function() { - var tmp = this.state.start; - this.state.start = this.state.lastTokEnd; - this.state.lastTokEnd = tmp; - - tmp = this.state.startLoc; - this.state.startLoc = this.state.lastTokEndLoc; - this.state.lastTokEndLoc = tmp; - - return this.finishNode(this.startNode(), "JSXEmptyExpression"); + let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.start, this.startLoc); }; // Parses JSX expression enclosed into curly brackets. pp.jsxParseExpressionContainer = function() { - var node = this.startNode(); + let node = this.startNode(); this.next(); if (this.match(tt.braceR)) { node.expression = this.jsxParseEmptyExpression(); @@ -285,7 +283,7 @@ pp.jsxParseExpressionContainer = function() { // Parses following JSX attribute name-value pair. pp.jsxParseAttribute = function() { - var node = this.startNode(); + let node = this.startNode(); if (this.eat(tt.braceL)) { this.expect(tt.ellipsis); node.argument = this.parseMaybeAssign(); @@ -300,7 +298,7 @@ pp.jsxParseAttribute = function() { // Parses JSX opening tag starting after "<". pp.jsxParseOpeningElementAt = function(startPos, startLoc) { - var node = this.startNodeAt(startPos, startLoc); + let node = this.startNodeAt(startPos, startLoc); node.attributes = []; node.name = this.jsxParseElementName(); while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) { @@ -314,7 +312,7 @@ pp.jsxParseOpeningElementAt = function(startPos, startLoc) { // Parses JSX closing tag starting after "= this.input.length) return this.finishToken(tt.eof); @@ -162,7 +154,7 @@ export default class Tokenizer { } pushComment(block, text, start, end, startLoc, endLoc) { - var comment = { + let comment = { type: block ? "CommentBlock" : "CommentLine", value: text, start: start, @@ -308,11 +300,11 @@ export default class Tokenizer { } readToken_mult_modulo(code) { // '%*' - var type = code === 42 ? tt.star : tt.modulo; - var width = 1; - var next = this.input.charCodeAt(this.state.pos + 1); + let type = code === 42 ? tt.star : tt.modulo; + let width = 1; + let next = this.input.charCodeAt(this.state.pos + 1); - if (next === 42 && this.hasFeature("exponentiationOperator")) { // '*' + if (next === 42 && this.hasPlugin("exponentiationOperator")) { // '*' width++; next = this.input.charCodeAt(this.state.pos + 2); type = tt.exponent; @@ -415,7 +407,7 @@ export default class Tokenizer { case 125: ++this.state.pos; return this.finishToken(tt.braceR); case 58: - if (this.hasFeature("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { + if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { return this.finishOp(tt.doubleColon, 2); } else { ++this.state.pos; @@ -694,8 +686,14 @@ export default class Tokenizer { octalStr = octalStr.slice(0, -1); octal = parseInt(octalStr, 8); } - if (octal > 0 && (this.state.strict || inTemplate)) { - this.raise(this.state.pos - 2, "Octal literal in strict mode"); + if (octal > 0) { + if (!this.state.containsOctal) { + this.state.containsOctal = true; + this.state.octalPosition = this.state.pos - 2; + } + if (this.state.strict || inTemplate) { + this.raise(this.state.pos - 2, "Octal literal in strict mode"); + } } this.state.pos += octalStr.length - 1; return String.fromCharCode(octal); diff --git a/src/tokenizer/state.js b/src/tokenizer/state.js index b536a1fd8a..63107de019 100644 --- a/src/tokenizer/state.js +++ b/src/tokenizer/state.js @@ -14,7 +14,7 @@ export default class State { this.potentialArrowAt = -1; - this.inFunction = this.inGenerator = false; + this.inMethod = this.inFunction = this.inGenerator = this.inAsync = false; this.labels = []; @@ -42,7 +42,8 @@ export default class State { this.context = [ct.b_stat]; this.exprAllowed = true; - this.containsEsc = false; + this.containsEsc = this.containsOctal = false; + this.octalPosition = null; return this; } @@ -59,6 +60,7 @@ export default class State { // Flags to track whether we are in a function, a generator. inFunction: boolean; inGenerator: boolean; + inMethod: boolean; // Labels in scope. labels: Array; @@ -115,16 +117,20 @@ export default class State { // escape sequences must not be interpreted as keywords. containsEsc: boolean; + // TODO + containsOctal: boolean; + octalPosition: ?number; + curPosition() { return new Position(this.curLine, this.pos - this.lineStart); } clone(skipArrays?) { - var state = new State; - for (var key in this) { - var val = this[key]; + let state = new State; + for (let key in this) { + let val = this[key]; - if (!skipArrays && Array.isArray(val)) { + if ((!skipArrays || key === "context") && Array.isArray(val)) { val = val.slice(); } diff --git a/src/tokenizer/types.js b/src/tokenizer/types.js index 90b60f4ca2..fa8ff99bab 100644 --- a/src/tokenizer/types.js +++ b/src/tokenizer/types.js @@ -115,7 +115,7 @@ kw("catch"); kw("continue"); kw("debugger"); kw("default", beforeExpr); -kw("do", {isLoop: true}); +kw("do", {isLoop: true, beforeExpr: true}); kw("else", beforeExpr); kw("finally"); kw("for", {isLoop: true}); diff --git a/src/util/identifier.js b/src/util/identifier.js index 947e993ade..09045f8af0 100644 --- a/src/util/identifier.js +++ b/src/util/identifier.js @@ -49,7 +49,7 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; // offset starts at 0x10000, and each pair of numbers represents an // offset to the next range, and then a size of the range. They were // generated by tools/generate-identifier-regex.js -var astralIdentifierStartCodes = [ +let astralIdentifierStartCodes = [ 0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 99, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 98, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, @@ -62,7 +62,7 @@ var astralIdentifierStartCodes = [ 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 16355, 541 ]; -var astralIdentifierCodes = [ +let astralIdentifierCodes = [ 509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 16, 9, 83, 11, 168, 11, 6, 9, 8, 2, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 316, 19, 13, 9, 214, 6, 3, 8, 112, 16, 16, 9, 82, 12, 9, 9, 535, 9, 20855, 9, 135, 4, 60, 6, diff --git a/test/fixtures/comments/basic/export-default-anonymous-class/expected.json b/test/fixtures/comments/basic/export-default-anonymous-class/expected.json index 3599105db1..e42c57b979 100755 --- a/test/fixtures/comments/basic/export-default-anonymous-class/expected.json +++ b/test/fixtures/comments/basic/export-default-anonymous-class/expected.json @@ -74,7 +74,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 103, "end": 119, "loc": { @@ -107,41 +107,26 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 110, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 112, "end": 119, "loc": { "start": { "line": 8, - "column": 11 + "column": 13 }, "end": { "line": 9, "column": 5 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 112, - "end": 119, - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 9, - "column": 5 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] }, "leadingComments": [ { diff --git a/test/fixtures/core/uncategorised/542/actual.js b/test/fixtures/core/uncategorised/.542/actual.js similarity index 100% rename from test/fixtures/core/uncategorised/542/actual.js rename to test/fixtures/core/uncategorised/.542/actual.js diff --git a/test/fixtures/core/uncategorised/542/options.json b/test/fixtures/core/uncategorised/.542/options.json similarity index 100% rename from test/fixtures/core/uncategorised/542/options.json rename to test/fixtures/core/uncategorised/.542/options.json diff --git a/test/fixtures/core/uncategorised/543/actual.js b/test/fixtures/core/uncategorised/.543/actual.js similarity index 100% rename from test/fixtures/core/uncategorised/543/actual.js rename to test/fixtures/core/uncategorised/.543/actual.js diff --git a/test/fixtures/core/uncategorised/543/options.json b/test/fixtures/core/uncategorised/.543/options.json similarity index 100% rename from test/fixtures/core/uncategorised/543/options.json rename to test/fixtures/core/uncategorised/.543/options.json diff --git a/test/fixtures/core/uncategorised/544/actual.js b/test/fixtures/core/uncategorised/.544/actual.js similarity index 100% rename from test/fixtures/core/uncategorised/544/actual.js rename to test/fixtures/core/uncategorised/.544/actual.js diff --git a/test/fixtures/core/uncategorised/544/options.json b/test/fixtures/core/uncategorised/.544/options.json similarity index 100% rename from test/fixtures/core/uncategorised/544/options.json rename to test/fixtures/core/uncategorised/.544/options.json diff --git a/test/fixtures/core/uncategorised/22/expected.json b/test/fixtures/core/uncategorised/22/expected.json index 0ea258d194..f0a884e6c3 100644 --- a/test/fixtures/core/uncategorised/22/expected.json +++ b/test/fixtures/core/uncategorised/22/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 16, "loc": { @@ -140,8 +140,7 @@ "raw": "42" }, "value": 42 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/core/uncategorised/23/expected.json b/test/fixtures/core/uncategorised/23/expected.json index 6000da8339..dd3a42f49d 100644 --- a/test/fixtures/core/uncategorised/23/expected.json +++ b/test/fixtures/core/uncategorised/23/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 12, "loc": { @@ -140,8 +140,7 @@ "raw": "42" }, "value": 42 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/core/uncategorised/24/expected.json b/test/fixtures/core/uncategorised/24/expected.json index a958d6780e..cbc5697de4 100644 --- a/test/fixtures/core/uncategorised/24/expected.json +++ b/test/fixtures/core/uncategorised/24/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 14, "loc": { @@ -140,8 +140,7 @@ "raw": "42" }, "value": 42 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/core/uncategorised/25/expected.json b/test/fixtures/core/uncategorised/25/expected.json index d4911b1226..bff1f7f9e9 100644 --- a/test/fixtures/core/uncategorised/25/expected.json +++ b/test/fixtures/core/uncategorised/25/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 15, "loc": { @@ -140,8 +140,7 @@ "raw": "42" }, "value": 42 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/core/uncategorised/26/expected.json b/test/fixtures/core/uncategorised/26/expected.json index 61e13ba2b5..ced9c6f1e5 100644 --- a/test/fixtures/core/uncategorised/26/expected.json +++ b/test/fixtures/core/uncategorised/26/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 14, "loc": { @@ -140,8 +140,7 @@ "raw": "42" }, "value": 42 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/core/uncategorised/27/expected.json b/test/fixtures/core/uncategorised/27/expected.json index e7f3c00497..6cfa1d9324 100644 --- a/test/fixtures/core/uncategorised/27/expected.json +++ b/test/fixtures/core/uncategorised/27/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 18, "loc": { @@ -144,8 +144,7 @@ "raw": "42" }, "value": 42 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/core/uncategorised/275/expected.json b/test/fixtures/core/uncategorised/275/expected.json index 0ddcce0c63..1586888a8b 100644 --- a/test/fixtures/core/uncategorised/275/expected.json +++ b/test/fixtures/core/uncategorised/275/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 8, "end": 24, "loc": { @@ -109,8 +109,7 @@ "raw": "\"Error\"" }, "value": "Error" - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/core/uncategorised/28/expected.json b/test/fixtures/core/uncategorised/28/expected.json index d7de811e96..0f013c127d 100644 --- a/test/fixtures/core/uncategorised/28/expected.json +++ b/test/fixtures/core/uncategorised/28/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 10, "loc": { @@ -140,11 +140,10 @@ "raw": "1" }, "value": 1 - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 12, "end": 16, "loc": { @@ -195,8 +194,7 @@ "raw": "2" }, "value": 2 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/core/uncategorised/29/expected.json b/test/fixtures/core/uncategorised/29/expected.json index 6cd7aee600..1462403c0d 100644 --- a/test/fixtures/core/uncategorised/29/expected.json +++ b/test/fixtures/core/uncategorised/29/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 36, "loc": { @@ -122,78 +122,65 @@ "name": "width" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 15, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, "end": 36, "loc": { "start": { "line": 1, - "column": 15 + "column": 18 }, "end": { "line": 1, "column": 36 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 + "body": [ + { + "type": "ReturnStatement", + "start": 20, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 34 + } }, - "end": { - "line": 1, - "column": 36 - } - }, - "body": [ - { - "type": "ReturnStatement", - "start": 20, + "argument": { + "type": "Identifier", + "start": 27, "end": 34, "loc": { "start": { "line": 1, - "column": 20 + "column": 27 }, "end": { "line": 1, "column": 34 } }, - "argument": { - "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - }, - "name": "m_width" - } + "name": "m_width" } - ] - } + } + ], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/30/expected.json b/test/fixtures/core/uncategorised/30/expected.json index bfcf233e05..7694f2fd33 100644 --- a/test/fixtures/core/uncategorised/30/expected.json +++ b/test/fixtures/core/uncategorised/30/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 20, "loc": { @@ -122,46 +122,33 @@ "name": "undef" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 15, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, "end": 20, "loc": { "start": { "line": 1, - "column": 15 + "column": 18 }, "end": { "line": 1, "column": 20 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/31/expected.json b/test/fixtures/core/uncategorised/31/expected.json index a81f0be417..966b9f90ca 100644 --- a/test/fixtures/core/uncategorised/31/expected.json +++ b/test/fixtures/core/uncategorised/31/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 17, "loc": { @@ -122,46 +122,33 @@ "name": "if" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 12, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, "end": 17, "loc": { "start": { "line": 1, - "column": 12 + "column": 15 }, "end": { "line": 1, "column": 17 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/32/expected.json b/test/fixtures/core/uncategorised/32/expected.json index 755ded80c2..0ab2082d42 100644 --- a/test/fixtures/core/uncategorised/32/expected.json +++ b/test/fixtures/core/uncategorised/32/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 19, "loc": { @@ -122,46 +122,33 @@ "name": "true" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 14, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, "end": 19, "loc": { "start": { "line": 1, - "column": 14 + "column": 17 }, "end": { "line": 1, "column": 19 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/33/expected.json b/test/fixtures/core/uncategorised/33/expected.json index c8111bb6cc..ccc78d04a7 100644 --- a/test/fixtures/core/uncategorised/33/expected.json +++ b/test/fixtures/core/uncategorised/33/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 20, "loc": { @@ -122,46 +122,33 @@ "name": "false" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 15, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, "end": 20, "loc": { "start": { "line": 1, - "column": 15 + "column": 18 }, "end": { "line": 1, "column": 20 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/34/expected.json b/test/fixtures/core/uncategorised/34/expected.json index dd04ddeac2..c8ef1380a8 100644 --- a/test/fixtures/core/uncategorised/34/expected.json +++ b/test/fixtures/core/uncategorised/34/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 19, "loc": { @@ -122,46 +122,33 @@ "name": "null" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 14, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, "end": 19, "loc": { "start": { "line": 1, - "column": 14 + "column": 17 }, "end": { "line": 1, "column": 19 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/35/expected.json b/test/fixtures/core/uncategorised/35/expected.json index da3ec9be77..6a4504c896 100644 --- a/test/fixtures/core/uncategorised/35/expected.json +++ b/test/fixtures/core/uncategorised/35/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 22, "loc": { @@ -126,41 +126,26 @@ "value": "undef" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 17, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, "end": 22, "loc": { "start": { "line": 1, - "column": 17 + "column": 20 }, "end": { "line": 1, "column": 22 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/core/uncategorised/36/expected.json b/test/fixtures/core/uncategorised/36/expected.json index a7cfe82d4d..7ff1fbb46b 100644 --- a/test/fixtures/core/uncategorised/36/expected.json +++ b/test/fixtures/core/uncategorised/36/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 17, "loc": { @@ -126,41 +126,26 @@ "value": 10 }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 12, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, "end": 17, "loc": { "start": { "line": 1, - "column": 12 + "column": 15 }, "end": { "line": 1, "column": 17 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/core/uncategorised/37/expected.json b/test/fixtures/core/uncategorised/37/expected.json index 04f9698103..ad75991dc1 100644 --- a/test/fixtures/core/uncategorised/37/expected.json +++ b/test/fixtures/core/uncategorised/37/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 34, "loc": { @@ -122,58 +122,58 @@ "name": "width" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 15, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, "end": 34, "loc": { "start": { "line": 1, - "column": 15 + "column": 19 }, "end": { "line": 1, "column": 34 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ + "body": [ { - "type": "Identifier", - "start": 16, - "end": 17, + "type": "ExpressionStatement", + "start": 21, + "end": 32, "loc": { "start": { "line": 1, - "column": 16 + "column": 21 }, "end": { "line": 1, - "column": 17 + "column": 32 } }, - "name": "w" - } - ], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", "start": 21, "end": 32, "loc": { @@ -186,63 +186,50 @@ "column": 32 } }, - "expression": { - "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", "start": 21, - "end": 32, + "end": 28, "loc": { "start": { "line": 1, "column": 21 }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "m_width" + }, + "right": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, "end": { "line": 1, "column": 32 } }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "name": "m_width" - }, - "right": { - "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "name": "w" - } + "name": "w" } } - ] - } + } + ], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/38/expected.json b/test/fixtures/core/uncategorised/38/expected.json index 360b95f14c..e290b184de 100644 --- a/test/fixtures/core/uncategorised/38/expected.json +++ b/test/fixtures/core/uncategorised/38/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 28, "loc": { @@ -122,58 +122,58 @@ "name": "if" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 12, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, "end": 28, "loc": { "start": { "line": 1, - "column": 12 + "column": 16 }, "end": { "line": 1, "column": 28 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ + "body": [ { - "type": "Identifier", - "start": 13, - "end": 14, + "type": "ExpressionStatement", + "start": 18, + "end": 26, "loc": { "start": { "line": 1, - "column": 13 + "column": 18 }, "end": { "line": 1, - "column": 14 + "column": 26 } }, - "name": "w" - } - ], - "body": { - "type": "BlockStatement", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", "start": 18, "end": 26, "loc": { @@ -186,63 +186,50 @@ "column": 26 } }, - "expression": { - "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", "start": 18, - "end": 26, + "end": 22, "loc": { "start": { "line": 1, "column": 18 }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "m_if" + }, + "right": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, "end": { "line": 1, "column": 26 } }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "name": "m_if" - }, - "right": { - "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "name": "w" - } + "name": "w" } } - ] - } + } + ], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/39/expected.json b/test/fixtures/core/uncategorised/39/expected.json index 3a2ec9b899..60ca06a14b 100644 --- a/test/fixtures/core/uncategorised/39/expected.json +++ b/test/fixtures/core/uncategorised/39/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 32, "loc": { @@ -122,58 +122,58 @@ "name": "true" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 14, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, "end": 32, "loc": { "start": { "line": 1, - "column": 14 + "column": 18 }, "end": { "line": 1, "column": 32 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ + "body": [ { - "type": "Identifier", - "start": 15, - "end": 16, + "type": "ExpressionStatement", + "start": 20, + "end": 30, "loc": { "start": { "line": 1, - "column": 15 + "column": 20 }, "end": { "line": 1, - "column": 16 + "column": 30 } }, - "name": "w" - } - ], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", "start": 20, "end": 30, "loc": { @@ -186,63 +186,50 @@ "column": 30 } }, - "expression": { - "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", "start": 20, - "end": 30, + "end": 26, "loc": { "start": { "line": 1, "column": 20 }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "m_true" + }, + "right": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, "end": { "line": 1, "column": 30 } }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "name": "m_true" - }, - "right": { - "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "name": "w" - } + "name": "w" } } - ] - } + } + ], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/40/expected.json b/test/fixtures/core/uncategorised/40/expected.json index 198c6f8e8d..2e92b355f6 100644 --- a/test/fixtures/core/uncategorised/40/expected.json +++ b/test/fixtures/core/uncategorised/40/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 34, "loc": { @@ -122,58 +122,58 @@ "name": "false" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 15, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, "end": 34, "loc": { "start": { "line": 1, - "column": 15 + "column": 19 }, "end": { "line": 1, "column": 34 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ + "body": [ { - "type": "Identifier", - "start": 16, - "end": 17, + "type": "ExpressionStatement", + "start": 21, + "end": 32, "loc": { "start": { "line": 1, - "column": 16 + "column": 21 }, "end": { "line": 1, - "column": 17 + "column": 32 } }, - "name": "w" - } - ], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", "start": 21, "end": 32, "loc": { @@ -186,63 +186,50 @@ "column": 32 } }, - "expression": { - "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", "start": 21, - "end": 32, + "end": 28, "loc": { "start": { "line": 1, "column": 21 }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "m_false" + }, + "right": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, "end": { "line": 1, "column": 32 } }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "name": "m_false" - }, - "right": { - "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "name": "w" - } + "name": "w" } } - ] - } + } + ], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/41/expected.json b/test/fixtures/core/uncategorised/41/expected.json index 8624ffd5ef..af9300d188 100644 --- a/test/fixtures/core/uncategorised/41/expected.json +++ b/test/fixtures/core/uncategorised/41/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 32, "loc": { @@ -122,58 +122,58 @@ "name": "null" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 14, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, "end": 32, "loc": { "start": { "line": 1, - "column": 14 + "column": 18 }, "end": { "line": 1, "column": 32 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ + "body": [ { - "type": "Identifier", - "start": 15, - "end": 16, + "type": "ExpressionStatement", + "start": 20, + "end": 30, "loc": { "start": { "line": 1, - "column": 15 + "column": 20 }, "end": { "line": 1, - "column": 16 + "column": 30 } }, - "name": "w" - } - ], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", "start": 20, "end": 30, "loc": { @@ -186,63 +186,50 @@ "column": 30 } }, - "expression": { - "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", "start": 20, - "end": 30, + "end": 26, "loc": { "start": { "line": 1, "column": 20 }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "m_null" + }, + "right": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, "end": { "line": 1, "column": 30 } }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "name": "m_null" - }, - "right": { - "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "name": "w" - } + "name": "w" } } - ] - } + } + ], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/42/expected.json b/test/fixtures/core/uncategorised/42/expected.json index 359994f749..7bc3ec6059 100644 --- a/test/fixtures/core/uncategorised/42/expected.json +++ b/test/fixtures/core/uncategorised/42/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 34, "loc": { @@ -126,58 +126,58 @@ "value": "null" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 16, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, "end": 34, "loc": { "start": { "line": 1, - "column": 16 + "column": 20 }, "end": { "line": 1, "column": 34 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ + "body": [ { - "type": "Identifier", - "start": 17, - "end": 18, + "type": "ExpressionStatement", + "start": 22, + "end": 32, "loc": { "start": { "line": 1, - "column": 17 + "column": 22 }, "end": { "line": 1, - "column": 18 + "column": 32 } }, - "name": "w" - } - ], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 34 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", "start": 22, "end": 32, "loc": { @@ -190,58 +190,43 @@ "column": 32 } }, - "expression": { - "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", "start": 22, - "end": 32, + "end": 28, "loc": { "start": { "line": 1, "column": 22 }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "m_null" + }, + "right": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, "end": { "line": 1, "column": 32 } }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "name": "m_null" - }, - "right": { - "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "name": "w" - } + "name": "w" } } - ], - "directives": [] - } + } + ], + "directives": [] } } ] diff --git a/test/fixtures/core/uncategorised/43/expected.json b/test/fixtures/core/uncategorised/43/expected.json index 40439f6021..7a72b8763e 100644 --- a/test/fixtures/core/uncategorised/43/expected.json +++ b/test/fixtures/core/uncategorised/43/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 30, "loc": { @@ -126,58 +126,58 @@ "value": 10 }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 12, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, "end": 30, "loc": { "start": { "line": 1, - "column": 12 + "column": 16 }, "end": { "line": 1, "column": 30 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ + "body": [ { - "type": "Identifier", - "start": 13, - "end": 14, + "type": "ExpressionStatement", + "start": 18, + "end": 28, "loc": { "start": { "line": 1, - "column": 13 + "column": 18 }, "end": { "line": 1, - "column": 14 + "column": 28 } }, - "name": "w" - } - ], - "body": { - "type": "BlockStatement", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", "start": 18, "end": 28, "loc": { @@ -190,58 +190,43 @@ "column": 28 } }, - "expression": { - "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", "start": 18, - "end": 28, + "end": 24, "loc": { "start": { "line": 1, "column": 18 }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "m_null" + }, + "right": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, "end": { "line": 1, "column": 28 } }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "name": "m_null" - }, - "right": { - "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "name": "w" - } + "name": "w" } } - ], - "directives": [] - } + } + ], + "directives": [] } } ] diff --git a/test/fixtures/core/uncategorised/44/expected.json b/test/fixtures/core/uncategorised/44/expected.json index 717aa6f7e7..b1dc510c8b 100644 --- a/test/fixtures/core/uncategorised/44/expected.json +++ b/test/fixtures/core/uncategorised/44/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 13, "loc": { @@ -140,8 +140,7 @@ "raw": "42" }, "value": 42 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/core/uncategorised/45/expected.json b/test/fixtures/core/uncategorised/45/expected.json index 01d280ce5b..e7eb6404f5 100644 --- a/test/fixtures/core/uncategorised/45/expected.json +++ b/test/fixtures/core/uncategorised/45/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 13, "loc": { @@ -140,8 +140,7 @@ "raw": "43" }, "value": 43 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json b/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json index 16876bb02e..a0efeec910 100644 --- a/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json @@ -136,7 +136,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 21, "end": 22, "loc": { @@ -168,7 +168,6 @@ }, "name": "c" }, - "kind": "init", "value": { "type": "Identifier", "start": 21, @@ -187,7 +186,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 24, "end": 29, "loc": { @@ -269,11 +268,10 @@ }, "value": 0 } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 31, "end": 38, "loc": { @@ -355,11 +353,10 @@ }, "value": 0 } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 40, "end": 43, "loc": { @@ -391,7 +388,6 @@ }, "name": "h" }, - "kind": "init", "value": { "type": "AssignmentPattern", "start": 40, diff --git a/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json b/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json index 2d14e8848e..1c46501964 100644 --- a/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json @@ -88,7 +88,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 7, "loc": { @@ -120,7 +120,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 6, diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json index fbd87bd0c4..8025e7a342 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json @@ -93,7 +93,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 8, "end": 20, "loc": { @@ -144,8 +144,7 @@ "raw": "42" }, "value": 42 - }, - "kind": "init" + } } ], "extra": { diff --git a/test/fixtures/esprima/es2015-class/migrated_0026/actual.js b/test/fixtures/esprima/es2015-class/.migrated_0026/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-class/migrated_0026/actual.js rename to test/fixtures/esprima/es2015-class/.migrated_0026/actual.js diff --git a/test/fixtures/esprima/es2015-class/migrated_0026/expected.json b/test/fixtures/esprima/es2015-class/.migrated_0026/expected.json similarity index 98% rename from test/fixtures/esprima/es2015-class/migrated_0026/expected.json rename to test/fixtures/esprima/es2015-class/.migrated_0026/expected.json index 7354aa5050..c69f6a312a 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0026/expected.json +++ b/test/fixtures/esprima/es2015-class/.migrated_0026/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 18, "loc": { diff --git a/test/fixtures/esprima/es2015-class/migrated_0004/expected.json b/test/fixtures/esprima/es2015-class/migrated_0004/expected.json index e60d7294c3..3e510efdc1 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0004/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0004/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 14, "loc": { @@ -107,45 +107,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 10, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 14, "loc": { "start": { "line": 1, - "column": 10 + "column": 12 }, "end": { "line": 1, "column": 14 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0005/expected.json b/test/fixtures/esprima/es2015-class/migrated_0005/expected.json index 4ead53f755..1ec03c3f48 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0005/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0005/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 14, "loc": { @@ -107,44 +107,30 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 10, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 14, "loc": { "start": { "line": 1, - "column": 10 + "column": 12 }, "end": { "line": 1, "column": 14 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 14, "end": 19, "loc": { @@ -176,45 +162,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 15, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, "end": 19, "loc": { "start": { "line": 1, - "column": 15 + "column": 17 }, "end": { "line": 1, "column": 19 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0006/expected.json b/test/fixtures/esprima/es2015-class/migrated_0006/expected.json index a4bb492dbb..c883c50114 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0006/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0006/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 14, "loc": { @@ -107,44 +107,30 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 10, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 14, "loc": { "start": { "line": 1, - "column": 10 + "column": 12 }, "end": { "line": 1, "column": 14 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 15, "end": 20, "loc": { @@ -176,45 +162,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 16, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, "end": 20, "loc": { "start": { "line": 1, - "column": 16 + "column": 18 }, "end": { "line": 1, "column": 20 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0007/expected.json b/test/fixtures/esprima/es2015-class/migrated_0007/expected.json index 77aa858ee4..57df44f925 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0007/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0007/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 14, "loc": { @@ -107,44 +107,30 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 10, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 14, "loc": { "start": { "line": 1, - "column": 10 + "column": 12 }, "end": { "line": 1, "column": 14 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 15, "end": 20, "loc": { @@ -176,45 +162,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 16, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, "end": 20, "loc": { "start": { "line": 1, - "column": 16 + "column": 18 }, "end": { "line": 1, "column": 20 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0008/expected.json b/test/fixtures/esprima/es2015-class/migrated_0008/expected.json index f0da7ec99b..129657a7fc 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0008/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0008/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 15, "loc": { @@ -107,44 +107,30 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 11, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, "end": 15, "loc": { "start": { "line": 1, - "column": 11 + "column": 13 }, "end": { "line": 1, "column": 15 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 16, "end": 21, "loc": { @@ -176,45 +162,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 17, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, "end": 21, "loc": { "start": { "line": 1, - "column": 17 + "column": 19 }, "end": { "line": 1, "column": 21 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0009/expected.json b/test/fixtures/esprima/es2015-class/migrated_0009/expected.json index 0cd6f1a23f..aa0a5f9344 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0009/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0009/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 19, "loc": { @@ -107,45 +107,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 15, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, "end": 19, "loc": { "start": { "line": 1, - "column": 15 + "column": 17 }, "end": { "line": 1, "column": 19 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0010/expected.json b/test/fixtures/esprima/es2015-class/migrated_0010/expected.json index b2101dd75c..92e8ef8e43 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0010/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0010/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 18, "loc": { @@ -107,44 +107,30 @@ }, "static": false, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 14, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, "end": 18, "loc": { "start": { "line": 1, - "column": 14 + "column": 16 }, "end": { "line": 1, "column": 18 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 19, "end": 29, "loc": { @@ -176,62 +162,49 @@ }, "static": false, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 24, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "c" + } + ], + "body": { + "type": "BlockStatement", + "start": 27, "end": 29, "loc": { "start": { "line": 1, - "column": 24 + "column": 27 }, "end": { "line": 1, "column": 29 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "name": "c" - } - ], - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0011/expected.json b/test/fixtures/esprima/es2015-class/migrated_0011/expected.json index 1c0665ae72..c6498e9b27 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0011/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0011/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 21, "loc": { @@ -107,44 +107,30 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 17, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, "end": 21, "loc": { "start": { "line": 1, - "column": 17 + "column": 19 }, "end": { "line": 1, "column": 21 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 22, "end": 38, "loc": { @@ -176,44 +162,30 @@ }, "static": true, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 34, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 36, "end": 38, "loc": { "start": { "line": 1, - "column": 34 + "column": 36 }, "end": { "line": 1, "column": 38 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 39, "end": 56, "loc": { @@ -245,62 +217,49 @@ }, "static": true, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 51, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "name": "b" + } + ], + "body": { + "type": "BlockStatement", + "start": 54, "end": 56, "loc": { "start": { "line": 1, - "column": 51 + "column": 54 }, "end": { "line": 1, "column": 56 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - }, - "name": "b" - } - ], - "body": { - "type": "BlockStatement", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 56 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0012/expected.json b/test/fixtures/esprima/es2015-class/migrated_0012/expected.json index b1acc4da5f..fa54d94267 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0012/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0012/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 21, "loc": { @@ -107,45 +107,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 17, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, "end": 21, "loc": { "start": { "line": 1, - "column": 17 + "column": 19 }, "end": { "line": 1, "column": 21 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0013/expected.json b/test/fixtures/esprima/es2015-class/migrated_0013/expected.json index a366c8ad3f..c7ff2d5228 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0013/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0013/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 23, "loc": { @@ -107,45 +107,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 19, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, "end": 23, "loc": { "start": { "line": 1, - "column": 19 + "column": 21 }, "end": { "line": 1, "column": 23 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0014/expected.json b/test/fixtures/esprima/es2015-class/migrated_0014/expected.json index b9887ebdf9..3a78f1bd7d 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0014/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0014/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 22, "loc": { @@ -107,44 +107,30 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 18, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, "end": 22, "loc": { "start": { "line": 1, - "column": 18 + "column": 20 }, "end": { "line": 1, "column": 22 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 24, "end": 37, "loc": { @@ -176,45 +162,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 33, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, "end": 37, "loc": { "start": { "line": 1, - "column": 33 + "column": 35 }, "end": { "line": 1, "column": 37 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0015/expected.json b/test/fixtures/esprima/es2015-class/migrated_0015/expected.json index 7e151a458e..ade3ae124b 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0015/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0015/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 26, "loc": { @@ -107,45 +107,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 22, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, "end": 26, "loc": { "start": { "line": 1, - "column": 22 + "column": 24 }, "end": { "line": 1, "column": 26 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0017/expected.json b/test/fixtures/esprima/es2015-class/migrated_0017/expected.json index a887878c99..2a2d1f81f9 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0017/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0017/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 22, "loc": { @@ -107,45 +107,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 18, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, "end": 22, "loc": { "start": { "line": 1, - "column": 18 + "column": 20 }, "end": { "line": 1, "column": 22 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0018/expected.json b/test/fixtures/esprima/es2015-class/migrated_0018/expected.json index 4ce9a1e28c..8a0d50c2c6 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0018/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0018/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 24, "loc": { @@ -107,45 +107,32 @@ }, "static": false, "kind": "constructor", - "value": { - "type": "FunctionExpression", - "start": 20, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, "end": 24, "loc": { "start": { "line": 1, - "column": 20 + "column": 22 }, "end": { "line": 1, "column": 24 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0019/expected.json b/test/fixtures/esprima/es2015-class/migrated_0019/expected.json index d991009313..72bb521716 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0019/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0019/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 26, "loc": { @@ -111,45 +111,30 @@ }, "static": false, "kind": "constructor", - "value": { - "type": "FunctionExpression", - "start": 22, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, "end": 26, "loc": { "start": { "line": 1, - "column": 22 + "column": 24 }, "end": { "line": 1, "column": 26 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 27, "end": 46, "loc": { @@ -185,41 +170,26 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 42, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 44, "end": 46, "loc": { "start": { "line": 1, - "column": 42 + "column": 44 }, "end": { "line": 1, "column": 46 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 46 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/esprima/es2015-class/migrated_0020/expected.json b/test/fixtures/esprima/es2015-class/migrated_0020/expected.json index 0241df155f..8ee060397d 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0020/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0020/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 31, "loc": { @@ -107,44 +107,30 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 27, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, "end": 31, "loc": { "start": { "line": 1, - "column": 27 + "column": 29 }, "end": { "line": 1, "column": 31 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 32, "end": 54, "loc": { @@ -176,45 +162,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 50, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 52, "end": 54, "loc": { "start": { "line": 1, - "column": 50 + "column": 52 }, "end": { "line": 1, "column": 54 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 54 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0021/expected.json b/test/fixtures/esprima/es2015-class/migrated_0021/expected.json index 21d43a0b9f..05b3f0a4ac 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0021/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0021/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 33, "loc": { @@ -111,41 +111,26 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 29, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, "end": 33, "loc": { "start": { "line": 1, - "column": 29 + "column": 31 }, "end": { "line": 1, "column": 33 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json index 0fdbc8a52e..64c3b49fae 100644 --- a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 25, "loc": { @@ -208,8 +208,7 @@ "body": [], "directives": [] } - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json index 70b18e9e2e..9c12c4fa9c 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json @@ -88,7 +88,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 5, "loc": { @@ -120,7 +120,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "AssignmentPattern", "start": 2, diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json index e4d7cfd018..559a8db8fc 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json @@ -373,7 +373,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 21, "end": 27, "loc": { @@ -405,7 +405,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "AssignmentPattern", "start": 21, diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json index 4521c6e3bf..aab8a1a69e 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 7, "end": 8, "loc": { @@ -105,7 +105,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 7, @@ -124,7 +123,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 14, "end": 17, "loc": { @@ -171,11 +170,10 @@ } }, "name": "a" - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 23, "end": 28, "loc": { @@ -253,11 +251,10 @@ }, "name": "a" } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 34, "end": 41, "loc": { @@ -305,7 +302,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 39, "end": 40, "loc": { @@ -337,7 +334,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 39, @@ -356,11 +352,10 @@ } } ] - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 47, "end": 63, "loc": { @@ -455,11 +450,10 @@ "name": "a" }, "computed": true - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 69, "end": 77, "loc": { @@ -537,8 +531,7 @@ "name": "a" }, "computed": false - }, - "kind": "init" + } } ] }, diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json index 5d9a5f6369..ae7eefb6d2 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 17, "end": 23, "loc": { @@ -109,8 +109,7 @@ "raw": "1" }, "value": 1 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json index 2fcb51b5b1..bf3b9e73b7 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json @@ -87,7 +87,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 12, "end": 13, "loc": { @@ -119,7 +119,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 12, @@ -138,7 +137,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 15, "end": 16, "loc": { @@ -170,7 +169,6 @@ }, "name": "y" }, - "kind": "init", "value": { "type": "Identifier", "start": 15, @@ -227,6 +225,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json index 9cfd59a3ab..025d0acd2b 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 7, "loc": { @@ -90,7 +90,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 6, @@ -109,7 +108,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 9, "end": 10, "loc": { @@ -141,7 +140,6 @@ }, "name": "y" }, - "kind": "init", "value": { "type": "Identifier", "start": 9, @@ -193,6 +191,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/actual.js b/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/actual.js rename to test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/actual.js diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/expected.json b/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/expected.json rename to test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json diff --git a/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/options.json b/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/options.json similarity index 100% rename from test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/options.json rename to test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/options.json diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json index 7c3e3bcb37..ef567c630d 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 19, "loc": { @@ -90,91 +90,76 @@ }, "name": "foo" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 7, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "z" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, "end": 19, "loc": { "start": { "line": 1, - "column": 7 + "column": 17 }, "end": { "line": 1, "column": 19 } }, - "id": null, - "generator": true, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - }, - "name": "x" - }, - { - "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "name": "y" - }, - { - "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "name": "z" - } - ], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json index 8b5ee65941..a261ce50a1 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 23, "loc": { @@ -90,44 +90,44 @@ }, "name": "foo" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 7, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, "end": 23, "loc": { "start": { "line": 1, - "column": 7 + "column": 10 }, "end": { "line": 1, "column": 23 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + } }, - "end": { - "line": 1, - "column": 23 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "YieldExpression", "start": 12, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -135,49 +135,34 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, - "expression": { - "type": "YieldExpression", - "start": 12, + "delegate": true, + "argument": { + "type": "NumberLiteral", + "start": 19, "end": 20, "loc": { "start": { "line": 1, - "column": 12 + "column": 19 }, "end": { "line": 1, "column": 20 } }, - "delegate": true, - "argument": { - "type": "NumberLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "extra": { - "rawValue": 3, - "raw": "3" - }, - "value": 3 - } + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 } } - ], - "directives": [] - } + } + ], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json index 14d2a18a84..d43ba66132 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 22, "loc": { @@ -90,44 +90,44 @@ }, "name": "foo" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 7, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, "end": 22, "loc": { "start": { "line": 1, - "column": 7 + "column": 10 }, "end": { "line": 1, "column": 22 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 10 + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "YieldExpression", "start": 12, - "end": 20, + "end": 19, "loc": { "start": { "line": 1, @@ -135,49 +135,34 @@ }, "end": { "line": 1, - "column": 20 + "column": 19 } }, - "expression": { - "type": "YieldExpression", - "start": 12, + "delegate": false, + "argument": { + "type": "NumberLiteral", + "start": 18, "end": 19, "loc": { "start": { "line": 1, - "column": 12 + "column": 18 }, "end": { "line": 1, "column": 19 } }, - "delegate": false, - "argument": { - "type": "NumberLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "extra": { - "rawValue": 3, - "raw": "3" - }, - "value": 3 - } + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 } } - ], - "directives": [] - } + } + ], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json index 110cc9c9cb..addacb6d05 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 26, "loc": { @@ -90,42 +90,42 @@ }, "name": "foo" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 7, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, "end": 26, "loc": { "start": { "line": 1, - "column": 7 + "column": 10 }, "end": { "line": 4, "column": 1 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 10, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 10 + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } }, - "end": { - "line": 4, - "column": 1 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "YieldExpression", "start": 15, "end": 20, "loc": { @@ -138,26 +138,26 @@ "column": 7 } }, - "expression": { - "type": "YieldExpression", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "delegate": false, - "argument": null + "delegate": false, + "argument": null + } + }, + { + "type": "ExpressionStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 } }, - { - "type": "ExpressionStatement", + "expression": { + "type": "NumberLiteral", "start": 23, "end": 24, "loc": { @@ -170,30 +170,15 @@ "column": 3 } }, - "expression": { - "type": "NumberLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "extra": { - "rawValue": 3, - "raw": "3" - }, - "value": 3 - } + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 } - ], - "directives": [] - } + } + ], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json index c749a9dbaf..9bd0e0fc9b 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 20, "loc": { @@ -90,44 +90,44 @@ }, "name": "foo" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 7, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, "end": 20, "loc": { "start": { "line": 1, - "column": 7 + "column": 10 }, "end": { "line": 1, "column": 20 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "YieldExpression", "start": 12, - "end": 18, + "end": 17, "loc": { "start": { "line": 1, @@ -135,30 +135,15 @@ }, "end": { "line": 1, - "column": 18 + "column": 17 } }, - "expression": { - "type": "YieldExpression", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "delegate": false, - "argument": null - } + "delegate": false, + "argument": null } - ], - "directives": [] - } + } + ], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-generator/generator-method/expected.json b/test/fixtures/esprima/es2015-generator/generator-method/expected.json index a5bb9c44cb..1edf3cf6b7 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 12, "loc": { @@ -90,42 +90,27 @@ }, "name": "foo" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 7, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, "end": 12, "loc": { "start": { "line": 1, - "column": 7 + "column": 10 }, "end": { "line": 1, "column": 12 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json b/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json index d257165465..39c163121b 100644 --- a/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json +++ b/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 12, "end": 30, "loc": { @@ -107,45 +107,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 25, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, "end": 30, "loc": { "start": { "line": 1, - "column": 25 + "column": 28 }, "end": { "line": 1, "column": 30 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json b/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json index bebbec9f26..655985c272 100644 --- a/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json +++ b/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 12, "end": 28, "loc": { @@ -107,45 +107,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 23, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, "end": 28, "loc": { "start": { "line": 1, - "column": 23 + "column": 26 }, "end": { "line": 1, "column": 28 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/invalid_function_wait/actual.js b/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-identifier/invalid_function_wait/actual.js rename to test/fixtures/esprima/es2015-identifier/.invalid_function_wait/actual.js diff --git a/test/fixtures/esprima/es2015-identifier/invalid_function_wait/expected.json b/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-identifier/invalid_function_wait/expected.json rename to test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json diff --git a/test/fixtures/esprima/es2015-identifier/invalid_function_wait/options.json b/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/options.json similarity index 100% rename from test/fixtures/esprima/es2015-identifier/invalid_function_wait/options.json rename to test/fixtures/esprima/es2015-identifier/.invalid_function_wait/options.json diff --git a/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/actual.js b/test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/actual.js rename to test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/actual.js diff --git a/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/expected.json b/test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/expected.json rename to test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/expected.json diff --git a/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/options.json b/test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/options.json similarity index 100% rename from test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/options.json rename to test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/options.json diff --git a/test/fixtures/esprima/es2015-meta-property/invalid-new-target/actual.js b/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-meta-property/invalid-new-target/actual.js rename to test/fixtures/esprima/es2015-meta-property/.invalid-new-target/actual.js diff --git a/test/fixtures/esprima/es2015-meta-property/invalid-new-target/expected.json b/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-meta-property/invalid-new-target/expected.json rename to test/fixtures/esprima/es2015-meta-property/.invalid-new-target/expected.json diff --git a/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json b/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/options.json similarity index 100% rename from test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json rename to test/fixtures/esprima/es2015-meta-property/.invalid-new-target/options.json diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json index 5d4235ff90..880dce74c2 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 18, "loc": { @@ -121,47 +121,34 @@ }, "name": "method" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 12, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, "end": 18, "loc": { "start": { "line": 1, - "column": 12 + "column": 15 }, "end": { "line": 1, "column": 18 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json index 9e72a8c644..7d5dce4954 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 22, "loc": { @@ -121,64 +121,51 @@ }, "name": "method" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 12, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "test" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, "end": 22, "loc": { "start": { "line": 1, - "column": 12 + "column": 19 }, "end": { "line": 1, "column": 22 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "test" - } - ], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json index e964b38846..1030bf0af2 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 20, "loc": { @@ -125,42 +125,27 @@ }, "value": "method" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 14, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, "end": 20, "loc": { "start": { "line": 1, - "column": 14 + "column": 17 }, "end": { "line": 1, "column": 20 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json index 986432a828..0b0d3f1c10 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 15, "loc": { @@ -121,47 +121,34 @@ }, "name": "get" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 9, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 15, "loc": { "start": { "line": 1, - "column": 9 + "column": 12 }, "end": { "line": 1, "column": 15 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json index 8d18a3447c..b118b76443 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 15, "loc": { @@ -121,47 +121,34 @@ }, "name": "set" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 9, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 15, "loc": { "start": { "line": 1, - "column": 9 + "column": 12 }, "end": { "line": 1, "column": 15 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-getter-literal-identifier/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-getter-literal-identifier/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-getter-literal-identifier/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-getter-literal-identifier/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-getter-literal-identifier/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-getter-literal-identifier/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-literal/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-literal/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-literal/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-literal/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-literal/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-literal/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-shorthand/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-shorthand/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-shorthand/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-shorthand/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-shorthand/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-shorthand/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifier-shorthand/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifiers/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifiers/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifiers/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifiers/expected.json new file mode 100644 index 0000000000..853ec2ca42 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifiers/expected.json @@ -0,0 +1,167 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "value": { + "type": "NullLiteral", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + }, + { + "type": "ObjectProperty", + "start": 20, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "__proto__" + }, + "value": { + "type": "NullLiteral", + "start": 31, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 35 + } + } + } + } + ], + "extra": { + "parenthesized": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifiers/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-identifiers/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-identifier/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-identifier/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-identifier/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-identifier/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-identifier/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-identifier/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-shorthand/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-shorthand/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-shorthand/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-shorthand/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-shorthand/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-shorthand/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literal-shorthand/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literals/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literals/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literals/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literals/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literals/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-literals/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-setter-literal-identifier/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-setter-literal-identifier/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-setter-literal-identifier/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-setter-literal-identifier/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-setter-literal-identifier/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-setter-literal-identifier/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-identifier/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-identifier/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-identifier/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-identifier/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-identifier/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-identifier/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-identifier/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-literal/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-literal/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-literal/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-literal/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-literal/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthand-literal/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthand-literal/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/actual.js b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthands/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/actual.js rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthands/actual.js diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/expected.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthands/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/expected.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthands/expected.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/options.json b/test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthands/options.json similarity index 100% rename from test/fixtures/esprima/es2015-object-initialiser/invalid-proto-shorthands/options.json rename to test/fixtures/esprima/es2015-object-initialiser/.invalid-proto-shorthands/options.json diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json index 370894461a..41fa69789a 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 18, "loc": { @@ -104,11 +104,10 @@ "column": 18 } } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectMethod", "start": 20, "end": 37, "loc": { @@ -141,45 +140,30 @@ "name": "__proto__" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 33, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, "end": 37, "loc": { "start": { "line": 1, - "column": 33 + "column": 35 }, "end": { "line": 1, "column": 37 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } }, { - "type": "Property", + "type": "ObjectMethod", "start": 39, "end": 57, "loc": { @@ -212,58 +196,43 @@ "name": "__proto__" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 52, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 55, "end": 57, "loc": { "start": { "line": 1, - "column": 52 + "column": 55 }, "end": { "line": 1, "column": 57 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 54 - } - }, - "name": "x" - } - ], - "body": { - "type": "BlockStatement", - "start": 55, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 57 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json index 987143a14c..73ee6c7acf 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 18, "loc": { @@ -104,11 +104,10 @@ "column": 18 } } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectMethod", "start": 20, "end": 37, "loc": { @@ -141,41 +140,26 @@ "name": "__proto__" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 33, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, "end": 37, "loc": { "start": { "line": 1, - "column": 33 + "column": 35 }, "end": { "line": 1, "column": 37 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json index 63dc917941..8213ba1bb4 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 18, "loc": { @@ -104,11 +104,10 @@ "column": 18 } } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectMethod", "start": 20, "end": 33, "loc": { @@ -140,42 +139,27 @@ }, "name": "__proto__" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 29, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, "end": 33, "loc": { "start": { "line": 1, - "column": 29 + "column": 31 }, "end": { "line": 1, "column": 33 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json index 70085edf6a..3e06b6b52c 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 18, "loc": { @@ -104,11 +104,10 @@ "column": 18 } } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectMethod", "start": 20, "end": 38, "loc": { @@ -141,58 +140,43 @@ "name": "__proto__" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 33, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 36, "end": 38, "loc": { "start": { "line": 1, - "column": 33 + "column": 36 }, "end": { "line": 1, "column": 38 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - }, - "name": "x" - } - ], - "body": { - "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json index 48f265cc99..a1524c4a1f 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 20, "loc": { @@ -108,11 +108,10 @@ "column": 20 } } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectMethod", "start": 22, "end": 39, "loc": { @@ -145,45 +144,30 @@ "name": "__proto__" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 35, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 37, "end": 39, "loc": { "start": { "line": 1, - "column": 35 + "column": 37 }, "end": { "line": 1, "column": 39 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } }, { - "type": "Property", + "type": "ObjectMethod", "start": 41, "end": 59, "loc": { @@ -216,58 +200,43 @@ "name": "__proto__" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 54, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 57, "end": 59, "loc": { "start": { "line": 1, - "column": 54 + "column": 57 }, "end": { "line": 1, "column": 59 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 56 - } - }, - "name": "x" - } - ], - "body": { - "type": "BlockStatement", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 59 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json index c6bdefacea..5fe032f20e 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 20, "loc": { @@ -108,11 +108,10 @@ "column": 20 } } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectMethod", "start": 22, "end": 39, "loc": { @@ -145,41 +144,26 @@ "name": "__proto__" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 35, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 37, "end": 39, "loc": { "start": { "line": 1, - "column": 35 + "column": 37 }, "end": { "line": 1, "column": 39 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json index f414d0c2e1..2a6d87e4c9 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 20, "loc": { @@ -108,11 +108,10 @@ "column": 20 } } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectMethod", "start": 22, "end": 35, "loc": { @@ -144,42 +143,27 @@ }, "name": "__proto__" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 31, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 33, "end": 35, "loc": { "start": { "line": 1, - "column": 31 + "column": 33 }, "end": { "line": 1, "column": 35 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json index 501fa19f68..d0c7453baa 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 20, "loc": { @@ -108,11 +108,10 @@ "column": 20 } } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectMethod", "start": 22, "end": 40, "loc": { @@ -145,58 +144,43 @@ "name": "__proto__" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 35, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 38, "end": 40, "loc": { "start": { "line": 1, - "column": 35 + "column": 38 }, "end": { "line": 1, "column": 40 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "name": "x" - } - ], - "body": { - "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json index 83f868da39..660265dd75 100644 --- a/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 7, "loc": { @@ -121,7 +121,6 @@ }, "name": "y" }, - "kind": "init", "value": { "type": "Identifier", "start": 6, @@ -140,7 +139,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 9, "end": 10, "loc": { @@ -172,7 +171,6 @@ }, "name": "z" }, - "kind": "init", "value": { "type": "Identifier", "start": 9, @@ -194,6 +192,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/elision/expected.json b/test/fixtures/esprima/es2015-object-pattern/elision/expected.json index 6b892f7870..7c4ad06015 100644 --- a/test/fixtures/esprima/es2015-object-pattern/elision/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/elision/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 6, "loc": { @@ -105,7 +105,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, diff --git a/test/fixtures/esprima/es2015-object-pattern/nested/expected.json b/test/fixtures/esprima/es2015-object-pattern/nested/expected.json index 2b2774d691..91ef151596 100644 --- a/test/fixtures/esprima/es2015-object-pattern/nested/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/nested/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 9, "loc": { @@ -120,8 +120,7 @@ } }, "properties": [] - }, - "kind": "init" + } } ] }, diff --git a/test/fixtures/esprima/es2015-object-pattern/properties/expected.json b/test/fixtures/esprima/es2015-object-pattern/properties/expected.json index a7861a314f..385e1d7b27 100644 --- a/test/fixtures/esprima/es2015-object-pattern/properties/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/properties/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 6, "loc": { @@ -105,7 +105,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, @@ -124,7 +123,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 7, "end": 10, "loc": { @@ -156,7 +155,6 @@ }, "name": "b" }, - "kind": "init", "value": { "type": "AssignmentPattern", "start": 7, @@ -210,7 +208,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 11, "end": 14, "loc": { @@ -257,11 +255,10 @@ } }, "name": "d" - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 15, "end": 20, "loc": { @@ -343,11 +340,10 @@ }, "value": 0 } - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 21, "end": 28, "loc": { @@ -411,8 +407,7 @@ "name": "h" } ] - }, - "kind": "init" + } } ] }, diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json b/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json index e7736168c6..b5c022b8a6 100644 --- a/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json +++ b/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 29, "loc": { @@ -201,15 +201,16 @@ "column": 29 } }, - "body": [] + "body": [], + "directives": [] } - }, - "kind": "init" + } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json index aee5d3439b..18295991cb 100644 --- a/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json +++ b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 25, "loc": { @@ -121,79 +121,66 @@ }, "name": "method" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 12 + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } }, - "end": { - "line": 1, - "column": 25 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "start": 13, + "argument": { + "type": "Identifier", + "start": 16, "end": 20, "loc": { "start": { "line": 1, - "column": 13 + "column": 16 }, "end": { "line": 1, "column": 20 } }, - "argument": { - "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "name": "test" - } + "name": "test" } - ], - "body": { - "type": "BlockStatement", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "body": [] } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [] } } ] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_access/actual.js b/test/fixtures/esprima/es2015-super-property/.invalid_super_access/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-super-property/invalid_super_access/actual.js rename to test/fixtures/esprima/es2015-super-property/.invalid_super_access/actual.js diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_access/options.json b/test/fixtures/esprima/es2015-super-property/.invalid_super_access/options.json similarity index 100% rename from test/fixtures/esprima/es2015-super-property/invalid_super_access/options.json rename to test/fixtures/esprima/es2015-super-property/.invalid_super_access/options.json diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_id/actual.js b/test/fixtures/esprima/es2015-super-property/.invalid_super_id/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-super-property/invalid_super_id/actual.js rename to test/fixtures/esprima/es2015-super-property/.invalid_super_id/actual.js diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_id/expected.json b/test/fixtures/esprima/es2015-super-property/.invalid_super_id/expected.json similarity index 99% rename from test/fixtures/esprima/es2015-super-property/invalid_super_id/expected.json rename to test/fixtures/esprima/es2015-super-property/.invalid_super_id/expected.json index 9f101bba08..051ec3a5b8 100644 --- a/test/fixtures/esprima/es2015-super-property/invalid_super_id/expected.json +++ b/test/fixtures/esprima/es2015-super-property/.invalid_super_id/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 14, "end": 37, "loc": { diff --git a/test/fixtures/esprima/es2015-super-property/invalid_super_id/options.json b/test/fixtures/esprima/es2015-super-property/.invalid_super_id/options.json similarity index 100% rename from test/fixtures/esprima/es2015-super-property/invalid_super_id/options.json rename to test/fixtures/esprima/es2015-super-property/.invalid_super_id/options.json diff --git a/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json b/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json index b94e426219..76dcbec057 100644 --- a/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json +++ b/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json @@ -90,7 +90,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 24, "end": 67, "loc": { @@ -122,41 +122,41 @@ }, "static": false, "kind": "constructor", - "value": { - "type": "FunctionExpression", - "start": 35, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, "end": 67, "loc": { "start": { "line": 2, - "column": 15 + "column": 18 }, "end": { "line": 4, "column": 5 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 38, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 18 + "body": [ + { + "type": "ExpressionStatement", + "start": 48, + "end": 61, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 21 + } }, - "end": { - "line": 4, - "column": 5 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "ArrowFunctionExpression", "start": 48, "end": 61, "loc": { @@ -169,28 +169,28 @@ "column": 21 } }, - "expression": { - "type": "ArrowFunctionExpression", - "start": 48, + "id": null, + "generator": false, + "expression": true, + "params": [], + "body": { + "type": "CallExpression", + "start": 54, "end": 61, "loc": { "start": { "line": 3, - "column": 8 + "column": 14 }, "end": { "line": 3, "column": 21 } }, - "id": null, - "generator": false, - "expression": true, - "params": [], - "body": { - "type": "CallExpression", + "callee": { + "type": "Super", "start": 54, - "end": 61, + "end": 59, "loc": { "start": { "line": 3, @@ -198,35 +198,22 @@ }, "end": { "line": 3, - "column": 21 + "column": 19 } - }, - "callee": { - "type": "Super", - "start": 54, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 19 - } - } - }, - "arguments": [] - } + } + }, + "arguments": [] } } - ] - } + } + ], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json b/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json index dd99c7bb8e..aad408ba61 100644 --- a/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json +++ b/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json @@ -90,7 +90,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 24, "end": 62, "loc": { @@ -122,43 +122,43 @@ }, "static": false, "kind": "constructor", - "value": { - "type": "FunctionExpression", - "start": 35, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, "end": 62, "loc": { "start": { "line": 2, - "column": 15 + "column": 18 }, "end": { "line": 4, "column": 5 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 38, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 18 + "body": [ + { + "type": "ExpressionStatement", + "start": 48, + "end": 56, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 16 + } }, - "end": { - "line": 4, - "column": 5 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", "start": 48, - "end": 56, + "end": 55, "loc": { "start": { "line": 3, @@ -166,13 +166,13 @@ }, "end": { "line": 3, - "column": 16 + "column": 15 } }, - "expression": { - "type": "CallExpression", + "callee": { + "type": "Super", "start": 48, - "end": 55, + "end": 53, "loc": { "start": { "line": 3, @@ -180,34 +180,21 @@ }, "end": { "line": 3, - "column": 15 + "column": 13 } - }, - "callee": { - "type": "Super", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - } - } - }, - "arguments": [] - } + } + }, + "arguments": [] } - ] - } + } + ], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/new_super/expected.json b/test/fixtures/esprima/es2015-super-property/new_super/expected.json index d86a834f70..4bf3b459c2 100644 --- a/test/fixtures/esprima/es2015-super-property/new_super/expected.json +++ b/test/fixtures/esprima/es2015-super-property/new_super/expected.json @@ -90,7 +90,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 24, "end": 61, "loc": { @@ -122,41 +122,41 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 27, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, "end": 61, "loc": { "start": { "line": 2, - "column": 7 + "column": 10 }, "end": { "line": 4, "column": 5 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 30, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 10 + "body": [ + { + "type": "ExpressionStatement", + "start": 40, + "end": 55, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 23 + } }, - "end": { - "line": 4, - "column": 5 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "NewExpression", "start": 40, "end": 55, "loc": { @@ -169,77 +169,64 @@ "column": 23 } }, - "expression": { - "type": "NewExpression", - "start": 40, - "end": 55, + "callee": { + "type": "MemberExpression", + "start": 44, + "end": 53, "loc": { "start": { "line": 3, - "column": 8 + "column": 12 }, "end": { "line": 3, - "column": 23 + "column": 21 } }, - "callee": { - "type": "MemberExpression", + "object": { + "type": "Super", "start": 44, - "end": 53, + "end": 49, "loc": { "start": { "line": 3, "column": 12 }, + "end": { + "line": 3, + "column": 17 + } + } + }, + "property": { + "type": "Identifier", + "start": 50, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 18 + }, "end": { "line": 3, "column": 21 } }, - "object": { - "type": "Super", - "start": 44, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 17 - } - } - }, - "property": { - "type": "Identifier", - "start": 50, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 21 - } - }, - "name": "bar" - }, - "computed": false + "name": "bar" }, - "arguments": [] - } + "computed": false + }, + "arguments": [] } - ] - } + } + ], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/super_computed/expected.json b/test/fixtures/esprima/es2015-super-property/super_computed/expected.json index fc8eabf3ce..0187540a76 100644 --- a/test/fixtures/esprima/es2015-super-property/super_computed/expected.json +++ b/test/fixtures/esprima/es2015-super-property/super_computed/expected.json @@ -90,7 +90,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 24, "end": 59, "loc": { @@ -122,57 +122,57 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 25, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, "end": 59, "loc": { "start": { "line": 2, - "column": 5 + "column": 8 }, "end": { "line": 4, "column": 5 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 28, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 8 + "body": [ + { + "type": "ReturnStatement", + "start": 38, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 23 + } }, - "end": { - "line": 4, - "column": 5 - } - }, - "body": [ - { - "type": "ReturnStatement", - "start": 38, + "argument": { + "type": "MemberExpression", + "start": 45, "end": 53, "loc": { "start": { "line": 3, - "column": 8 + "column": 15 }, "end": { "line": 3, "column": 23 } }, - "argument": { - "type": "MemberExpression", + "object": { + "type": "Super", "start": 45, - "end": 53, + "end": 50, "loc": { "start": { "line": 3, @@ -180,50 +180,35 @@ }, "end": { "line": 3, - "column": 23 + "column": 20 + } + } + }, + "property": { + "type": "NumberLiteral", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 22 } }, - "object": { - "type": "Super", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 20 - } - } + "extra": { + "rawValue": 1, + "raw": "1" }, - "property": { - "type": "NumberLiteral", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - } - }, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - }, - "computed": true - } + "value": 1 + }, + "computed": true } - ], - "directives": [] - } + } + ], + "directives": [] } } ] diff --git a/test/fixtures/esprima/es2015-super-property/super_member/expected.json b/test/fixtures/esprima/es2015-super-property/super_member/expected.json index ad4ef9c6c4..9b939e582b 100644 --- a/test/fixtures/esprima/es2015-super-property/super_member/expected.json +++ b/test/fixtures/esprima/es2015-super-property/super_member/expected.json @@ -90,7 +90,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 24, "end": 58, "loc": { @@ -122,108 +122,95 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 25, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, "end": 58, "loc": { "start": { "line": 2, - "column": 5 + "column": 8 }, "end": { "line": 4, "column": 5 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 28, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 8 + "body": [ + { + "type": "ReturnStatement", + "start": 38, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 22 + } }, - "end": { - "line": 4, - "column": 5 - } - }, - "body": [ - { - "type": "ReturnStatement", - "start": 38, + "argument": { + "type": "MemberExpression", + "start": 45, "end": 52, "loc": { "start": { "line": 3, - "column": 8 + "column": 15 }, "end": { "line": 3, "column": 22 } }, - "argument": { - "type": "MemberExpression", + "object": { + "type": "Super", "start": 45, - "end": 52, + "end": 50, "loc": { "start": { "line": 3, "column": 15 }, + "end": { + "line": 3, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 21 + }, "end": { "line": 3, "column": 22 } }, - "object": { - "type": "Super", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 20 - } - } - }, - "property": { - "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - } - }, - "name": "y" - }, - "computed": false - } + "name": "y" + }, + "computed": false } - ] - } + } + ], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/octal-literal/actual.js b/test/fixtures/esprima/es2015-template-literals/.octal-literal/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-template-literals/octal-literal/actual.js rename to test/fixtures/esprima/es2015-template-literals/.octal-literal/actual.js diff --git a/test/fixtures/esprima/es2015-template-literals/octal-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-template-literals/octal-literal/expected.json rename to test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json diff --git a/test/fixtures/esprima/es2015-template-literals/octal-literal/options.json b/test/fixtures/esprima/es2015-template-literals/.octal-literal/options.json similarity index 100% rename from test/fixtures/esprima/es2015-template-literals/octal-literal/options.json rename to test/fixtures/esprima/es2015-template-literals/.octal-literal/options.json diff --git a/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/actual.js b/test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-template-literals/strict-octal-literal/actual.js rename to test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/actual.js diff --git a/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-template-literals/strict-octal-literal/expected.json rename to test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/expected.json diff --git a/test/fixtures/esprima/es2015-template-literals/strict-octal-literal/options.json b/test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/options.json similarity index 100% rename from test/fixtures/esprima/es2015-template-literals/strict-octal-literal/options.json rename to test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/options.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/actual.js b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/actual.js rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/actual.js diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/expected.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/expected.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/options.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/options.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/actual.js b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/actual.js rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/actual.js diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/expected.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/options.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/options.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/actual.js b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/actual.js rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/actual.js diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/expected.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/options.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/options.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/actual.js b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/actual.js rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/actual.js diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/expected.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/options.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/options.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/actual.js b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/actual.js rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/actual.js diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/expected.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/options.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/options.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/actual.js b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/actual.js rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/actual.js diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/expected.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/options.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/options.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/actual.js b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/actual.js rename to test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/actual.js diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/expected.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/options.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/options.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/actual.js b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/actual.js rename to test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/actual.js diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/expected.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/expected.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/options.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/options.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/actual.js b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/actual.js rename to test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/actual.js diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/expected.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/expected.json diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/options.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json rename to test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/options.json diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/actual.js b/test/fixtures/esprima/es2015-yield/.yield-generator-arrow-concise-body/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/actual.js rename to test/fixtures/esprima/es2015-yield/.yield-generator-arrow-concise-body/actual.js diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/expected.json b/test/fixtures/esprima/es2015-yield/.yield-generator-arrow-concise-body/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/expected.json rename to test/fixtures/esprima/es2015-yield/.yield-generator-arrow-concise-body/expected.json diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-function-expression/actual.js b/test/fixtures/esprima/es2015-yield/.yield-generator-function-expression/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/yield-generator-function-expression/actual.js rename to test/fixtures/esprima/es2015-yield/.yield-generator-function-expression/actual.js diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/actual.js b/test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/actual.js similarity index 100% rename from test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/actual.js rename to test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/actual.js diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/expected.json b/test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json similarity index 100% rename from test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/expected.json rename to test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json diff --git a/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json b/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json index 350b3f3ac2..09eb1bcbb8 100644 --- a/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 14, "loc": { @@ -120,8 +120,7 @@ } }, "name": "yield" - }, - "kind": "init" + } } ] }, @@ -145,6 +144,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json index 65944e5be1..7b85a9fef5 100644 --- a/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 14, "loc": { @@ -120,8 +120,7 @@ } }, "name": "x" - }, - "kind": "init" + } } ] }, @@ -145,6 +144,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json index dbe92db430..660094298e 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 14, "loc": { @@ -90,42 +90,27 @@ }, "name": "yield" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 9, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 14, "loc": { "start": { "line": 1, - "column": 9 + "column": 12 }, "end": { "line": 1, "column": 14 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json index f491ff04fd..b212d5a14f 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json @@ -77,7 +77,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 13, "end": 21, "loc": { @@ -124,8 +124,7 @@ } }, "name": "y" - }, - "kind": "init" + } } ] } @@ -144,9 +143,11 @@ "column": 25 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-method/expected.json b/test/fixtures/esprima/es2015-yield/yield-method/expected.json index 7ef2282cd6..73a6d2827d 100644 --- a/test/fixtures/esprima/es2015-yield/yield-method/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-method/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 13, "loc": { @@ -90,42 +90,27 @@ }, "name": "yield" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 8, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, "end": 13, "loc": { "start": { "line": 1, - "column": 8 + "column": 11 }, "end": { "line": 1, "column": 13 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json b/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json index 68bee782bd..f0dc7b4f27 100644 --- a/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json @@ -77,7 +77,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 12, "end": 20, "loc": { @@ -124,8 +124,7 @@ } }, "name": "y" - }, - "kind": "init" + } } ] } @@ -144,9 +143,11 @@ "column": 24 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json index c48e078e6b..687e8f341a 100644 --- a/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 20, "end": 28, "loc": { @@ -120,8 +120,7 @@ } }, "name": "x" - }, - "kind": "init" + } } ] }, diff --git a/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json b/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json index 2773f3f558..e71a000bbe 100644 --- a/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 17, "end": 27, "loc": { @@ -90,42 +90,27 @@ }, "name": "yield" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 22, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, "end": 27, "loc": { "start": { "line": 1, - "column": 22 + "column": 25 }, "end": { "line": 1, "column": 27 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json index 4e179ca792..ef8158ed4e 100644 --- a/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json @@ -90,7 +90,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 20, "end": 39, "loc": { @@ -122,41 +122,41 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 21, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, "end": 39, "loc": { "start": { "line": 1, - "column": 21 + "column": 24 }, "end": { "line": 1, "column": 39 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 24, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 24 + "body": [ + { + "type": "ExpressionStatement", + "start": 26, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 37 + } }, - "end": { - "line": 1, - "column": 39 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "MemberExpression", "start": 26, "end": 37, "loc": { @@ -169,61 +169,48 @@ "column": 37 } }, - "expression": { - "type": "MemberExpression", + "object": { + "type": "Super", "start": 26, - "end": 37, + "end": 31, "loc": { "start": { "line": 1, "column": 26 }, + "end": { + "line": 1, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 32 + }, "end": { "line": 1, "column": 37 } }, - "object": { - "type": "Super", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "property": { - "type": "Identifier", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "name": "yield" - }, - "computed": false - } + "name": "yield" + }, + "computed": false } - ] - } + } + ], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-09/actual.js b/test/fixtures/esprima/invalid-syntax/.GH-1106-09/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/GH-1106-09/actual.js rename to test/fixtures/esprima/invalid-syntax/.GH-1106-09/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-09/expected.json b/test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/GH-1106-09/expected.json rename to test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/GH-1106-09/options.json b/test/fixtures/esprima/invalid-syntax/.GH-1106-09/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/GH-1106-09/options.json rename to test/fixtures/esprima/invalid-syntax/.GH-1106-09/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0033/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0033/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0033/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0033/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0033/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0033/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0033/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0033/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0033/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0033/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0033/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0034/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0034/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0034/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0034/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0034/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0034/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0034/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0034/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0034/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0034/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0034/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0035/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0035/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0035/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0035/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0035/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0035/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0035/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0035/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0035/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0035/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0035/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0035/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0036/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0036/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0036/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0036/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0036/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0036/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0036/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0036/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0036/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0036/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0036/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0037/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0037/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0037/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0037/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0037/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0037/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0037/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0037/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0037/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0037/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0037/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0041/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0041/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0041/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0041/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0041/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0041/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0041/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0041/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0041/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0041/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0041/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0042/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0042/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0042/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0042/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0042/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0042/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0042/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0042/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0042/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0042/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0042/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0043/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0043/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0043/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0043/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0043/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0043/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0043/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0043/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0043/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0043/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0043/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0044/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0044/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0044/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0044/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0044/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0044/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0044/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0044/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0044/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0044/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0044/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0048/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0048/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0048/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0048/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0048/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0048/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0048/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0048/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0048/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0048/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0048/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0049/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0049/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0049/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0049/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0049/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0049/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0049/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0049/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0049/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0049/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0049/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0050/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0050/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0050/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0050/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0050/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0050/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0050/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0050/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0050/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0050/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0050/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0051/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0051/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0051/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0051/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0051/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0051/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0051/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0051/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0051/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0051/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0051/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0075/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0075/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0075/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0075/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0075/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0075/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0075/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0137/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0137/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0137/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0137/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0137/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0137/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0137/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0137/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0137/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0137/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0137/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0163/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0163/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0163/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0163/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0163/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0163/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0163/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0163/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0163/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0163/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0163/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0165/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0165/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0165/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0165/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0165/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0165/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0165/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0165/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0165/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0165/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0165/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0166/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0166/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0166/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0166/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0166/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0166/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0166/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0166/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0166/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0166/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0166/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0167/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0167/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0167/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0167/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0167/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0167/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0167/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0167/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0167/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0167/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0167/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0169/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0169/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0169/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0169/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0169/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0169/expected.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0169/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0169/expected.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0169/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0169/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0169/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0169/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0250/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0250/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0250/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0250/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0250/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0250/expected.json new file mode 100644 index 0000000000..d6b7e5702f --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0250/expected.json @@ -0,0 +1,206 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "__proto__" + }, + "value": { + "type": "NumberLiteral", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + }, + { + "type": "ObjectProperty", + "start": 21, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "name": "__proto__" + }, + "value": { + "type": "NumberLiteral", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "extra": { + "rawValue": 43, + "raw": "43" + }, + "value": 43 + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0250/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0250/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0250/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0277/actual.js b/test/fixtures/esprima/invalid-syntax/.migrated_0277/actual.js similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0277/actual.js rename to test/fixtures/esprima/invalid-syntax/.migrated_0277/actual.js diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0277/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0277/expected.json similarity index 98% rename from test/fixtures/esprima/invalid-syntax/migrated_0277/expected.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0277/expected.json index 0fa4cd9032..374479f48a 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0277/expected.json +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0277/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 18, "loc": { diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json b/test/fixtures/esprima/invalid-syntax/.migrated_0277/options.json similarity index 100% rename from test/fixtures/esprima/invalid-syntax/migrated_0277/options.json rename to test/fixtures/esprima/invalid-syntax/.migrated_0277/options.json diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0270/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0270/expected.json index 5830cef10e..ee4de023b7 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0270/expected.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0270/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 29, "loc": { diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0271/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0271/expected.json index 6cc3ea74c2..d1b5f89276 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0271/expected.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0271/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 31, "loc": { diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0278/expected.json b/test/fixtures/esprima/invalid-syntax/migrated_0278/expected.json index 966e05ade4..1e47cb6c1c 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0278/expected.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0278/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 28, "loc": { diff --git a/test/fixtures/esprima/statement-if/migrated_0003/actual.js b/test/fixtures/esprima/statement-if/.migrated_0003/actual.js similarity index 100% rename from test/fixtures/esprima/statement-if/migrated_0003/actual.js rename to test/fixtures/esprima/statement-if/.migrated_0003/actual.js diff --git a/test/fixtures/esprima/statement-iteration/migrated_0021/actual.js b/test/fixtures/esprima/statement-iteration/.migrated_0021/actual.js similarity index 100% rename from test/fixtures/esprima/statement-iteration/migrated_0021/actual.js rename to test/fixtures/esprima/statement-iteration/.migrated_0021/actual.js diff --git a/test/fixtures/esprima/statement-iteration/migrated_0021/expected.json b/test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json similarity index 100% rename from test/fixtures/esprima/statement-iteration/migrated_0021/expected.json rename to test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json diff --git a/test/fixtures/esprima/statement-iteration/pattern-in-for-in/actual.js b/test/fixtures/esprima/statement-iteration/.pattern-in-for-in/actual.js similarity index 100% rename from test/fixtures/esprima/statement-iteration/pattern-in-for-in/actual.js rename to test/fixtures/esprima/statement-iteration/.pattern-in-for-in/actual.js diff --git a/test/fixtures/esprima/statement-throw/migrated_0002/expected.json b/test/fixtures/esprima/statement-throw/migrated_0002/expected.json index 0ddcce0c63..1586888a8b 100644 --- a/test/fixtures/esprima/statement-throw/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-throw/migrated_0002/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 8, "end": 24, "loc": { @@ -109,8 +109,7 @@ "raw": "\"Error\"" }, "value": "Error" - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/experimental/async-functions/object-last-property-shorthand/expected.json b/test/fixtures/experimental/async-functions/object-last-property-shorthand/expected.json index b43eede7d6..bd3c1e7695 100644 --- a/test/fixtures/experimental/async-functions/object-last-property-shorthand/expected.json +++ b/test/fixtures/experimental/async-functions/object-last-property-shorthand/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 11, "loc": { @@ -120,7 +120,6 @@ }, "name": "async" }, - "kind": "init", "value": { "type": "Identifier", "start": 6, @@ -143,6 +142,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/async-functions/pattern/expected.json b/test/fixtures/experimental/async-functions/pattern/expected.json index 26dffdc586..339a3925ef 100644 --- a/test/fixtures/experimental/async-functions/pattern/expected.json +++ b/test/fixtures/experimental/async-functions/pattern/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 7, "end": 12, "loc": { @@ -105,7 +105,6 @@ }, "name": "async" }, - "kind": "init", "value": { "type": "Identifier", "start": 7, diff --git a/test/fixtures/experimental/class-constructor-call/.duplicate/actual.js b/test/fixtures/experimental/class-constructor-call/.duplicate/actual.js new file mode 100644 index 0000000000..6fd5dd7d11 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/.duplicate/actual.js @@ -0,0 +1,4 @@ +class Foo { + call constructor() {} + call constructor() {} +} diff --git a/test/fixtures/experimental/class-constructor-call/illegal-generator/actual.js b/test/fixtures/experimental/class-constructor-call/illegal-generator/actual.js new file mode 100644 index 0000000000..9a3bd5d8d6 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/illegal-generator/actual.js @@ -0,0 +1,5 @@ +class Foo { + *call constructor() { + foo(); + } +} diff --git a/test/fixtures/experimental/class-constructor-call/illegal-generator/options.json b/test/fixtures/experimental/class-constructor-call/illegal-generator/options.json new file mode 100644 index 0000000000..ef2b7c682f --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/illegal-generator/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:8)" +} diff --git a/test/fixtures/experimental/class-constructor-call/illegal-key/actual.js b/test/fixtures/experimental/class-constructor-call/illegal-key/actual.js new file mode 100644 index 0000000000..e3155a24a8 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/illegal-key/actual.js @@ -0,0 +1,5 @@ +class Foo { + call foobar() { + foo(); + } +} diff --git a/test/fixtures/experimental/class-constructor-call/illegal-key/options.json b/test/fixtures/experimental/class-constructor-call/illegal-key/options.json new file mode 100644 index 0000000000..4e84114247 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/illegal-key/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:7)" +} diff --git a/test/fixtures/experimental/class-constructor-call/options.json b/test/fixtures/experimental/class-constructor-call/options.json new file mode 100644 index 0000000000..253cf5199b --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classConstructorCall"] +} diff --git a/test/fixtures/experimental/class-constructor-call/plain/actual.js b/test/fixtures/experimental/class-constructor-call/plain/actual.js new file mode 100644 index 0000000000..1f8b64ef4a --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/plain/actual.js @@ -0,0 +1,5 @@ +class Foo { + call constructor() { + foo(); + } +} diff --git a/test/fixtures/experimental/class-constructor-call/plain/expected.json b/test/fixtures/experimental/class-constructor-call/plain/expected.json new file mode 100644 index 0000000000..49c89dadbc --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/plain/expected.json @@ -0,0 +1,186 @@ +{ + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 14, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "name": "constructor" + }, + "static": false, + "kind": "constructorCall", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 39, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "expression": { + "type": "CallExpression", + "start": 39, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 39, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/24/actual.js b/test/fixtures/experimental/uncategorised/.24/actual.js similarity index 100% rename from test/fixtures/experimental/uncategorised/24/actual.js rename to test/fixtures/experimental/uncategorised/.24/actual.js diff --git a/test/fixtures/experimental/uncategorised/24/expected.json b/test/fixtures/experimental/uncategorised/.24/expected.json similarity index 100% rename from test/fixtures/experimental/uncategorised/24/expected.json rename to test/fixtures/experimental/uncategorised/.24/expected.json diff --git a/test/fixtures/experimental/uncategorised/24/options.json b/test/fixtures/experimental/uncategorised/.24/options.json similarity index 100% rename from test/fixtures/experimental/uncategorised/24/options.json rename to test/fixtures/experimental/uncategorised/.24/options.json diff --git a/test/fixtures/experimental/uncategorised/10/expected.json b/test/fixtures/experimental/uncategorised/10/expected.json index a9e67765ef..f017a9cc8e 100644 --- a/test/fixtures/experimental/uncategorised/10/expected.json +++ b/test/fixtures/experimental/uncategorised/10/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 6, "loc": { @@ -105,7 +105,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, diff --git a/test/fixtures/experimental/uncategorised/11/expected.json b/test/fixtures/experimental/uncategorised/11/expected.json index 5da577c081..64c2046836 100644 --- a/test/fixtures/experimental/uncategorised/11/expected.json +++ b/test/fixtures/experimental/uncategorised/11/expected.json @@ -76,7 +76,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 11, "end": 12, "loc": { @@ -108,7 +108,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 11, diff --git a/test/fixtures/experimental/uncategorised/13/expected.json b/test/fixtures/experimental/uncategorised/13/expected.json index bbf2490867..13c6c8dc0c 100644 --- a/test/fixtures/experimental/uncategorised/13/expected.json +++ b/test/fixtures/experimental/uncategorised/13/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 6, "loc": { @@ -121,7 +121,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, @@ -174,6 +173,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/14/expected.json b/test/fixtures/experimental/uncategorised/14/expected.json index de5cd3bace..761b028be8 100644 --- a/test/fixtures/experimental/uncategorised/14/expected.json +++ b/test/fixtures/experimental/uncategorised/14/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 3, "loc": { @@ -90,7 +90,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 2, @@ -140,7 +139,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 11, "end": 12, "loc": { @@ -172,7 +171,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 11, @@ -222,7 +220,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 20, "end": 21, "loc": { @@ -254,7 +252,6 @@ }, "name": "c" }, - "kind": "init", "value": { "type": "Identifier", "start": 20, diff --git a/test/fixtures/experimental/uncategorised/21/expected.json b/test/fixtures/experimental/uncategorised/21/expected.json index d6700e7b80..05a0c068cb 100644 --- a/test/fixtures/experimental/uncategorised/21/expected.json +++ b/test/fixtures/experimental/uncategorised/21/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 10, "end": 14, "loc": { @@ -140,11 +140,10 @@ "raw": "1" }, "value": 1 - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectMethod", "start": 16, "end": 52, "loc": { @@ -176,60 +175,60 @@ }, "name": "foo" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 25, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "promise" + } + ], + "body": { + "type": "BlockStatement", + "start": 35, "end": 52, "loc": { "start": { "line": 1, - "column": 25 + "column": 35 }, "end": { "line": 1, "column": 52 } }, - "id": null, - "generator": false, - "expression": false, - "async": true, - "params": [ + "body": [ { - "type": "Identifier", - "start": 26, - "end": 33, + "type": "ExpressionStatement", + "start": 37, + "end": 50, "loc": { "start": { "line": 1, - "column": 26 + "column": 37 }, "end": { "line": 1, - "column": 33 + "column": 50 } }, - "name": "promise" - } - ], - "body": { - "type": "BlockStatement", - "start": 35, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 52 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "AwaitExpression", "start": 37, "end": 50, "loc": { @@ -242,42 +241,27 @@ "column": 50 } }, - "expression": { - "type": "AwaitExpression", - "start": 37, + "all": false, + "argument": { + "type": "Identifier", + "start": 43, "end": 50, "loc": { "start": { "line": 1, - "column": 37 + "column": 43 }, "end": { "line": 1, "column": 50 } }, - "all": false, - "argument": { - "type": "Identifier", - "start": 43, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 50 - } - }, - "name": "promise" - } + "name": "promise" } } - ], - "directives": [] - } + } + ], + "directives": [] } } ] diff --git a/test/fixtures/experimental/uncategorised/22/expected.json b/test/fixtures/experimental/uncategorised/22/expected.json index 3f2e2fe5b0..a0fd07d512 100644 --- a/test/fixtures/experimental/uncategorised/22/expected.json +++ b/test/fixtures/experimental/uncategorised/22/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 12, "end": 48, "loc": { @@ -107,59 +107,59 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 21, + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "promise" + } + ], + "body": { + "type": "BlockStatement", + "start": 31, "end": 48, "loc": { "start": { "line": 1, - "column": 21 + "column": 31 }, "end": { "line": 1, "column": 48 } }, - "id": null, - "generator": false, - "expression": false, - "async": true, - "params": [ + "body": [ { - "type": "Identifier", - "start": 22, - "end": 29, + "type": "ExpressionStatement", + "start": 33, + "end": 46, "loc": { "start": { "line": 1, - "column": 22 + "column": 33 }, "end": { "line": 1, - "column": 29 + "column": 46 } }, - "name": "promise" - } - ], - "body": { - "type": "BlockStatement", - "start": 31, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 48 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "AwaitExpression", "start": 33, "end": 46, "loc": { @@ -172,46 +172,33 @@ "column": 46 } }, - "expression": { - "type": "AwaitExpression", - "start": 33, + "all": false, + "argument": { + "type": "Identifier", + "start": 39, "end": 46, "loc": { "start": { "line": 1, - "column": 33 + "column": 39 }, "end": { "line": 1, "column": 46 } }, - "all": false, - "argument": { - "type": "Identifier", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 46 - } - }, - "name": "promise" - } + "name": "promise" } } - ] - } + } + ], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/29/expected.json b/test/fixtures/experimental/uncategorised/29/expected.json index 169869cbf6..0c05743d58 100644 --- a/test/fixtures/experimental/uncategorised/29/expected.json +++ b/test/fixtures/experimental/uncategorised/29/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 13, "end": 23, "loc": { @@ -107,41 +107,27 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 18, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, "end": 23, "loc": { "start": { "line": 1, - "column": 18 + "column": 21 }, "end": { "line": 1, "column": 23 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/experimental/uncategorised/30/expected.json b/test/fixtures/experimental/uncategorised/30/expected.json index 60fc936189..a5e072a934 100644 --- a/test/fixtures/experimental/uncategorised/30/expected.json +++ b/test/fixtures/experimental/uncategorised/30/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 12, "end": 25, "loc": { @@ -139,8 +139,7 @@ "raw": "\"test\"" }, "value": "test" - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/experimental/uncategorised/31/expected.json b/test/fixtures/experimental/uncategorised/31/expected.json index 55dbd1960c..1078686a77 100644 --- a/test/fixtures/experimental/uncategorised/31/expected.json +++ b/test/fixtures/experimental/uncategorised/31/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 12, "end": 22, "loc": { @@ -120,43 +120,28 @@ }, "name": "async" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 17, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, "end": 22, "loc": { "start": { "line": 1, - "column": 17 + "column": 20 }, "end": { "line": 1, "column": 22 } }, - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/experimental/uncategorised/35/expected.json b/test/fixtures/experimental/uncategorised/35/expected.json index 03c8437135..ff000260aa 100644 --- a/test/fixtures/experimental/uncategorised/35/expected.json +++ b/test/fixtures/experimental/uncategorised/35/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 17, "end": 25, "loc": { @@ -140,45 +140,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 20, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, "end": 25, "loc": { "start": { "line": 1, - "column": 20 + "column": 23 }, "end": { "line": 1, "column": 25 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/36/expected.json b/test/fixtures/experimental/uncategorised/36/expected.json index 50d2011f36..118d2b69c5 100644 --- a/test/fixtures/experimental/uncategorised/36/expected.json +++ b/test/fixtures/experimental/uncategorised/36/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 17, "end": 30, "loc": { @@ -140,62 +140,49 @@ }, "static": false, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 24, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "f" + } + ], + "body": { + "type": "BlockStatement", + "start": 28, "end": 30, "loc": { "start": { "line": 1, - "column": 24 + "column": 28 }, "end": { "line": 1, "column": 30 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "name": "f" - } - ], - "body": { - "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/37/expected.json b/test/fixtures/experimental/uncategorised/37/expected.json index ac0fa38fc3..ad67c94592 100644 --- a/test/fixtures/experimental/uncategorised/37/expected.json +++ b/test/fixtures/experimental/uncategorised/37/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 17, "end": 29, "loc": { @@ -140,45 +140,32 @@ }, "static": false, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 24, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, "end": 29, "loc": { "start": { "line": 1, - "column": 24 + "column": 27 }, "end": { "line": 1, "column": 29 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/38/expected.json b/test/fixtures/experimental/uncategorised/38/expected.json index c538000216..d55670aa51 100644 --- a/test/fixtures/experimental/uncategorised/38/expected.json +++ b/test/fixtures/experimental/uncategorised/38/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 22, "end": 30, "loc": { @@ -171,45 +171,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 25, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, "end": 30, "loc": { "start": { "line": 1, - "column": 25 + "column": 28 }, "end": { "line": 1, "column": 30 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/39/expected.json b/test/fixtures/experimental/uncategorised/39/expected.json index da6ab2aeb4..b8e2fae3e8 100644 --- a/test/fixtures/experimental/uncategorised/39/expected.json +++ b/test/fixtures/experimental/uncategorised/39/expected.json @@ -104,7 +104,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 12, "end": 22, "loc": { @@ -188,8 +188,7 @@ "raw": "\"bar\"" }, "value": "bar" - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/experimental/uncategorised/49/expected.json b/test/fixtures/experimental/uncategorised/49/expected.json index 0ca312dba2..1186fc6b42 100644 --- a/test/fixtures/experimental/uncategorised/49/expected.json +++ b/test/fixtures/experimental/uncategorised/49/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 17, "end": 27, "loc": { @@ -173,8 +173,7 @@ "raw": "'wow'" }, "value": "wow" - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/experimental/uncategorised/57/expected.json b/test/fixtures/experimental/uncategorised/57/expected.json index ebb3ee0019..84ddd9f145 100644 --- a/test/fixtures/experimental/uncategorised/57/expected.json +++ b/test/fixtures/experimental/uncategorised/57/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 12, "end": 23, "loc": { @@ -107,62 +107,49 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 15, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, "end": 23, "loc": { "start": { "line": 1, - "column": 15 + "column": 20 }, "end": { "line": 1, "column": 23 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "a" - } - ], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/flow/regression/arrow-function-parens-with-return-type/actual.js b/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/actual.js similarity index 100% rename from test/fixtures/flow/regression/arrow-function-parens-with-return-type/actual.js rename to test/fixtures/flow/regression/.arrow-function-parens-with-return-type/actual.js diff --git a/test/fixtures/flow/regression/arrow-function-parens-with-return-type/expected.json b/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json similarity index 100% rename from test/fixtures/flow/regression/arrow-function-parens-with-return-type/expected.json rename to test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json diff --git a/test/fixtures/flow/regression/arrow-function-parens-with-return-type/options.json b/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/options.json similarity index 100% rename from test/fixtures/flow/regression/arrow-function-parens-with-return-type/options.json rename to test/fixtures/flow/regression/.arrow-function-parens-with-return-type/options.json diff --git a/test/fixtures/flow/regression/issue-2083/expected.json b/test/fixtures/flow/regression/issue-2083/expected.json index f56868b0ee..9fc301b2fd 100644 --- a/test/fixtures/flow/regression/issue-2083/expected.json +++ b/test/fixtures/flow/regression/issue-2083/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 14, "end": 110, "loc": { @@ -107,93 +107,94 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 17, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, "end": 110, "loc": { "start": { "line": 2, - "column": 5 + "column": 8 }, "end": { "line": 6, "column": 3 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 110, - "loc": { - "start": { - "line": 2, - "column": 8 + "body": [ + { + "type": "SwitchStatement", + "start": 26, + "end": 106, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } }, - "end": { - "line": 6, - "column": 3 - } - }, - "body": [ - { - "type": "SwitchStatement", - "start": 26, - "end": 106, + "discriminant": { + "type": "NumberLiteral", + "start": 34, + "end": 35, "loc": { "start": { "line": 3, - "column": 4 + "column": 12 }, "end": { - "line": 5, - "column": 5 + "line": 3, + "column": 13 } }, - "discriminant": { - "type": "NumberLiteral", - "start": 34, - "end": 35, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "cases": [ + { + "type": "SwitchCase", + "start": 45, + "end": 100, "loc": { "start": { - "line": 3, - "column": 12 + "line": 4, + "column": 6 }, "end": { - "line": 3, - "column": 13 + "line": 4, + "column": 61 } }, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - }, - "cases": [ - { - "type": "SwitchCase", - "start": 45, - "end": 100, + "consequent": [], + "test": { + "type": "BinaryExpression", + "start": 51, + "end": 98, "loc": { "start": { "line": 4, - "column": 6 + "column": 12 }, "end": { "line": 4, - "column": 61 + "column": 59 } }, - "consequent": [], - "test": { - "type": "BinaryExpression", + "left": { + "type": "MemberExpression", "start": 51, - "end": 98, + "end": 71, "loc": { "start": { "line": 4, @@ -201,120 +202,105 @@ }, "end": { "line": 4, - "column": 59 + "column": 32 } }, - "left": { - "type": "MemberExpression", + "object": { + "type": "Identifier", "start": 51, - "end": 71, + "end": 61, "loc": { "start": { "line": 4, "column": 12 }, + "end": { + "line": 4, + "column": 22 + } + }, + "name": "MatrixType" + }, + "property": { + "type": "Identifier", + "start": 62, + "end": 71, + "loc": { + "start": { + "line": 4, + "column": 23 + }, "end": { "line": 4, "column": 32 } }, - "object": { - "type": "Identifier", - "start": 51, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 22 - } - }, - "name": "MatrixType" - }, - "property": { - "type": "Identifier", - "start": 62, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 23 - }, - "end": { - "line": 4, - "column": 32 - } - }, - "name": "IsScaling" - }, - "computed": false + "name": "IsScaling" }, - "operator": "|", - "right": { - "type": "MemberExpression", + "computed": false + }, + "operator": "|", + "right": { + "type": "MemberExpression", + "start": 74, + "end": 98, + "loc": { + "start": { + "line": 4, + "column": 35 + }, + "end": { + "line": 4, + "column": 59 + } + }, + "object": { + "type": "Identifier", "start": 74, - "end": 98, + "end": 84, "loc": { "start": { "line": 4, "column": 35 }, + "end": { + "line": 4, + "column": 45 + } + }, + "name": "MatrixType" + }, + "property": { + "type": "Identifier", + "start": 85, + "end": 98, + "loc": { + "start": { + "line": 4, + "column": 46 + }, "end": { "line": 4, "column": 59 } }, - "object": { - "type": "Identifier", - "start": 74, - "end": 84, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 45 - } - }, - "name": "MatrixType" - }, - "property": { - "type": "Identifier", - "start": 85, - "end": 98, - "loc": { - "start": { - "line": 4, - "column": 46 - }, - "end": { - "line": 4, - "column": 59 - } - }, - "name": "IsTranslation" - }, - "computed": false + "name": "IsTranslation" }, - "extra": { - "parenthesized": true - } + "computed": false + }, + "extra": { + "parenthesized": true } } - ] - } - ], - "directives": [] - } + } + ] + } + ], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 114, "end": 162, "loc": { @@ -346,71 +332,72 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 117, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 120, "end": 162, "loc": { "start": { "line": 8, - "column": 5 + "column": 8 }, "end": { "line": 10, "column": 3 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 120, - "end": 162, - "loc": { - "start": { - "line": 8, - "column": 8 + "body": [ + { + "type": "SwitchStatement", + "start": 126, + "end": 158, + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 36 + } }, - "end": { - "line": 10, - "column": 3 - } - }, - "body": [ - { - "type": "SwitchStatement", - "start": 126, - "end": 158, + "discriminant": { + "type": "BinaryExpression", + "start": 134, + "end": 154, "loc": { "start": { "line": 9, - "column": 4 + "column": 12 }, "end": { "line": 9, - "column": 36 + "column": 32 } }, - "discriminant": { + "left": { "type": "BinaryExpression", - "start": 134, - "end": 154, + "start": 135, + "end": 145, "loc": { "start": { "line": 9, - "column": 12 + "column": 13 }, "end": { "line": 9, - "column": 32 + "column": 23 } }, "left": { - "type": "BinaryExpression", + "type": "Identifier", "start": 135, - "end": 145, + "end": 140, "loc": { "start": { "line": 9, @@ -418,73 +405,58 @@ }, "end": { "line": 9, - "column": 23 + "column": 18 } }, - "left": { - "type": "Identifier", - "start": 135, - "end": 140, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 18 - } - }, - "name": "typeA" - }, - "operator": "<<", - "right": { - "type": "NumberLiteral", - "start": 144, - "end": 145, - "loc": { - "start": { - "line": 9, - "column": 22 - }, - "end": { - "line": 9, - "column": 23 - } - }, - "extra": { - "rawValue": 4, - "raw": "4" - }, - "value": 4 - }, - "extra": { - "parenthesized": true - } + "name": "typeA" }, - "operator": "|", + "operator": "<<", "right": { - "type": "Identifier", - "start": 149, - "end": 154, + "type": "NumberLiteral", + "start": 144, + "end": 145, "loc": { "start": { "line": 9, - "column": 27 + "column": 22 }, "end": { "line": 9, - "column": 32 + "column": 23 } }, - "name": "typeB" + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + }, + "extra": { + "parenthesized": true } }, - "cases": [] - } - ], - "directives": [] - } + "operator": "|", + "right": { + "type": "Identifier", + "start": 149, + "end": 154, + "loc": { + "start": { + "line": 9, + "column": 27 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "name": "typeB" + } + }, + "cases": [] + } + ], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/69/actual.js b/test/fixtures/flow/type-annotations/.69/actual.js similarity index 100% rename from test/fixtures/flow/type-annotations/69/actual.js rename to test/fixtures/flow/type-annotations/.69/actual.js diff --git a/test/fixtures/flow/type-annotations/69/expected.json b/test/fixtures/flow/type-annotations/.69/expected.json similarity index 100% rename from test/fixtures/flow/type-annotations/69/expected.json rename to test/fixtures/flow/type-annotations/.69/expected.json diff --git a/test/fixtures/flow/type-annotations/70/actual.js b/test/fixtures/flow/type-annotations/.70/actual.js similarity index 100% rename from test/fixtures/flow/type-annotations/70/actual.js rename to test/fixtures/flow/type-annotations/.70/actual.js diff --git a/test/fixtures/flow/type-annotations/70/expected.json b/test/fixtures/flow/type-annotations/.70/expected.json similarity index 100% rename from test/fixtures/flow/type-annotations/70/expected.json rename to test/fixtures/flow/type-annotations/.70/expected.json diff --git a/test/fixtures/flow/type-annotations/71/actual.js b/test/fixtures/flow/type-annotations/.71/actual.js similarity index 100% rename from test/fixtures/flow/type-annotations/71/actual.js rename to test/fixtures/flow/type-annotations/.71/actual.js diff --git a/test/fixtures/flow/type-annotations/71/expected.json b/test/fixtures/flow/type-annotations/.71/expected.json similarity index 100% rename from test/fixtures/flow/type-annotations/71/expected.json rename to test/fixtures/flow/type-annotations/.71/expected.json diff --git a/test/fixtures/flow/type-annotations/75/actual.js b/test/fixtures/flow/type-annotations/.75/actual.js similarity index 100% rename from test/fixtures/flow/type-annotations/75/actual.js rename to test/fixtures/flow/type-annotations/.75/actual.js diff --git a/test/fixtures/flow/type-annotations/75/expected.json b/test/fixtures/flow/type-annotations/.75/expected.json similarity index 100% rename from test/fixtures/flow/type-annotations/75/expected.json rename to test/fixtures/flow/type-annotations/.75/expected.json diff --git a/test/fixtures/flow/type-annotations/76/actual.js b/test/fixtures/flow/type-annotations/.76/actual.js similarity index 100% rename from test/fixtures/flow/type-annotations/76/actual.js rename to test/fixtures/flow/type-annotations/.76/actual.js diff --git a/test/fixtures/flow/type-annotations/76/expected.json b/test/fixtures/flow/type-annotations/.76/expected.json similarity index 100% rename from test/fixtures/flow/type-annotations/76/expected.json rename to test/fixtures/flow/type-annotations/.76/expected.json diff --git a/test/fixtures/flow/type-annotations/77/actual.js b/test/fixtures/flow/type-annotations/.77/actual.js similarity index 100% rename from test/fixtures/flow/type-annotations/77/actual.js rename to test/fixtures/flow/type-annotations/.77/actual.js diff --git a/test/fixtures/flow/type-annotations/77/expected.json b/test/fixtures/flow/type-annotations/.77/expected.json similarity index 100% rename from test/fixtures/flow/type-annotations/77/expected.json rename to test/fixtures/flow/type-annotations/.77/expected.json diff --git a/test/fixtures/flow/type-annotations/20/expected.json b/test/fixtures/flow/type-annotations/20/expected.json index 455aaeaa26..e21b48d766 100644 --- a/test/fixtures/flow/type-annotations/20/expected.json +++ b/test/fixtures/flow/type-annotations/20/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 30, "loc": { @@ -122,88 +122,74 @@ "name": "fooProp" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 14 + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + } }, - "end": { - "line": 1, - "column": 30 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 15, + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, "end": 27, "loc": { "start": { "line": 1, - "column": 15 + "column": 20 }, "end": { "line": 1, "column": 27 } }, - "name": "value", "typeAnnotation": { - "type": "TypeAnnotation", - "start": 20, + "type": "NumberTypeAnnotation", + "start": 21, "end": 27, "loc": { "start": { "line": 1, - "column": 20 + "column": 21 }, "end": { "line": 1, "column": 27 } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } } } } - ], - "body": { - "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "body": [], - "directives": [] } + ], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/21/expected.json b/test/fixtures/flow/type-annotations/21/expected.json index 3360af33e4..d1ddc78e40 100644 --- a/test/fixtures/flow/type-annotations/21/expected.json +++ b/test/fixtures/flow/type-annotations/21/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 35, "loc": { @@ -122,118 +122,104 @@ "name": "fooProp" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 14, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 14 + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + } }, - "end": { - "line": 1, - "column": 35 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 15, + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, "end": 27, "loc": { "start": { "line": 1, - "column": 15 + "column": 20 }, "end": { "line": 1, "column": 27 } }, - "name": "value", "typeAnnotation": { - "type": "TypeAnnotation", - "start": 20, + "type": "NumberTypeAnnotation", + "start": 21, "end": 27, "loc": { "start": { "line": 1, - "column": 20 + "column": 21 }, "end": { "line": 1, "column": 27 } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } } } } - ], - "returnType": { - "type": "TypeAnnotation", - "start": 28, + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "typeAnnotation": { + "type": "VoidTypeAnnotation", + "start": 29, "end": 33, "loc": { "start": { "line": 1, - "column": 28 + "column": 29 }, "end": { "line": 1, "column": 33 } - }, - "typeAnnotation": { - "type": "VoidTypeAnnotation", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 33 - } - } } - }, - "body": { - "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, - "body": [], - "directives": [] } + }, + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/22/expected.json b/test/fixtures/flow/type-annotations/22/expected.json index 2d660b9f77..4725285737 100644 --- a/test/fixtures/flow/type-annotations/22/expected.json +++ b/test/fixtures/flow/type-annotations/22/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 25, "loc": { @@ -122,71 +122,57 @@ "name": "fooProp" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 14, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + } + } + }, + "body": { + "type": "BlockStatement", + "start": 23, "end": 25, "loc": { "start": { "line": 1, - "column": 14 + "column": 23 }, "end": { "line": 1, "column": 25 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "returnType": { - "type": "TypeAnnotation", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - }, - "body": { - "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/23/expected.json b/test/fixtures/flow/type-annotations/23/expected.json index 75457f8544..0eb9320e3c 100644 --- a/test/fixtures/flow/type-annotations/23/expected.json +++ b/test/fixtures/flow/type-annotations/23/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 20, "loc": { @@ -121,56 +121,58 @@ }, "name": "id" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } }, - "end": { - "line": 1, - "column": 20 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 9, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 10, "end": 13, "loc": { "start": { "line": 1, - "column": 9 + "column": 10 }, "end": { "line": 1, "column": 13 } }, - "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", - "start": 10, + "type": "GenericTypeAnnotation", + "start": 12, "end": 13, "loc": { "start": { "line": 1, - "column": 10 + "column": 12 }, "end": { "line": 1, "column": 13 } }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", + "typeParameters": null, + "id": { + "type": "Identifier", "start": 12, "end": 13, "loc": { @@ -183,43 +185,43 @@ "column": 13 } }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "name": "T" - } + "name": "T" } } } - ], - "returnType": { - "type": "TypeAnnotation", - "start": 14, + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 16, "end": 17, "loc": { "start": { "line": 1, - "column": 14 + "column": 16 }, "end": { "line": 1, "column": 17 } }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", + "typeParameters": null, + "id": { + "type": "Identifier", "start": 16, "end": 17, "loc": { @@ -232,75 +234,59 @@ "column": 17 } }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "T" - } + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 } }, - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } + "body": [], + "directives": [] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 }, - "body": [], - "directives": [] + "end": { + "line": 1, + "column": 8 + } }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "params": [ - { - "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } + "params": [ + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "name": "T" - } - ] - } + "end": { + "line": 1, + "column": 7 + } + }, + "name": "T" + } + ] } } ] diff --git a/test/fixtures/flow/type-annotations/24/expected.json b/test/fixtures/flow/type-annotations/24/expected.json index 9990d3f183..ef4b2fa15b 100644 --- a/test/fixtures/flow/type-annotations/24/expected.json +++ b/test/fixtures/flow/type-annotations/24/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 21, "loc": { @@ -121,56 +121,58 @@ }, "name": "id" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } }, - "end": { - "line": 1, - "column": 21 - } - }, - "id": null, - "generator": true, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 10, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 11, "end": 14, "loc": { "start": { "line": 1, - "column": 10 + "column": 11 }, "end": { "line": 1, "column": 14 } }, - "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", - "start": 11, + "type": "GenericTypeAnnotation", + "start": 13, "end": 14, "loc": { "start": { "line": 1, - "column": 11 + "column": 13 }, "end": { "line": 1, "column": 14 } }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", + "typeParameters": null, + "id": { + "type": "Identifier", "start": 13, "end": 14, "loc": { @@ -183,43 +185,43 @@ "column": 14 } }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "name": "T" - } + "name": "T" } } } - ], - "returnType": { - "type": "TypeAnnotation", - "start": 15, + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 17, "end": 18, "loc": { "start": { "line": 1, - "column": 15 + "column": 17 }, "end": { "line": 1, "column": 18 } }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", + "typeParameters": null, + "id": { + "type": "Identifier", "start": 17, "end": 18, "loc": { @@ -232,75 +234,59 @@ "column": 18 } }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "T" - } + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 } }, - "body": { - "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } + "body": [], + "directives": [] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "body": [], - "directives": [] + "end": { + "line": 1, + "column": 9 + } }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, - "params": [ - { - "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } + "params": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 }, - "name": "T" - } - ] - } + "end": { + "line": 1, + "column": 8 + } + }, + "name": "T" + } + ] } } ] diff --git a/test/fixtures/flow/type-annotations/25/expected.json b/test/fixtures/flow/type-annotations/25/expected.json index 7a1c41ce8a..f651d57f91 100644 --- a/test/fixtures/flow/type-annotations/25/expected.json +++ b/test/fixtures/flow/type-annotations/25/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 26, "loc": { @@ -121,57 +121,58 @@ }, "name": "id" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } }, - "end": { - "line": 1, - "column": 26 - } - }, - "id": null, - "generator": false, - "expression": false, - "async": true, - "params": [ - { - "type": "Identifier", - "start": 15, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 16, "end": 19, "loc": { "start": { "line": 1, - "column": 15 + "column": 16 }, "end": { "line": 1, "column": 19 } }, - "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", - "start": 16, + "type": "GenericTypeAnnotation", + "start": 18, "end": 19, "loc": { "start": { "line": 1, - "column": 16 + "column": 18 }, "end": { "line": 1, "column": 19 } }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", + "typeParameters": null, + "id": { + "type": "Identifier", "start": 18, "end": 19, "loc": { @@ -184,43 +185,43 @@ "column": 19 } }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "name": "T" - } + "name": "T" } } } - ], - "returnType": { - "type": "TypeAnnotation", - "start": 20, + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 22, "end": 23, "loc": { "start": { "line": 1, - "column": 20 + "column": 22 }, "end": { "line": 1, "column": 23 } }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", + "typeParameters": null, + "id": { + "type": "Identifier", "start": 22, "end": 23, "loc": { @@ -233,81 +234,66 @@ "column": 23 } }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "name": "T" - } + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 } }, - "body": { - "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } + "body": [], + "directives": [] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 }, - "body": [] + "end": { + "line": 1, + "column": 14 + } }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "params": [ - { - "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 }, - "name": "T" - } - ] - } + "end": { + "line": 1, + "column": 13 + } + }, + "name": "T" + } + ] } } ] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/26/expected.json b/test/fixtures/flow/type-annotations/26/expected.json index c59c5c0979..32323b6fb7 100644 --- a/test/fixtures/flow/type-annotations/26/expected.json +++ b/test/fixtures/flow/type-annotations/26/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 21, "loc": { @@ -125,56 +125,58 @@ }, "value": 123 }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } }, - "end": { - "line": 1, - "column": 21 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 10, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 11, "end": 14, "loc": { "start": { "line": 1, - "column": 10 + "column": 11 }, "end": { "line": 1, "column": 14 } }, - "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", - "start": 11, + "type": "GenericTypeAnnotation", + "start": 13, "end": 14, "loc": { "start": { "line": 1, - "column": 11 + "column": 13 }, "end": { "line": 1, "column": 14 } }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", + "typeParameters": null, + "id": { + "type": "Identifier", "start": 13, "end": 14, "loc": { @@ -187,43 +189,43 @@ "column": 14 } }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "name": "T" - } + "name": "T" } } } - ], - "returnType": { - "type": "TypeAnnotation", - "start": 15, + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 17, "end": 18, "loc": { "start": { "line": 1, - "column": 15 + "column": 17 }, "end": { "line": 1, "column": 18 } }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", + "typeParameters": null, + "id": { + "type": "Identifier", "start": 17, "end": 18, "loc": { @@ -236,75 +238,59 @@ "column": 18 } }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "T" - } + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 } }, - "body": { - "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } + "body": [], + "directives": [] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "body": [], - "directives": [] + "end": { + "line": 1, + "column": 9 + } }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, - "params": [ - { - "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } + "params": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 }, - "name": "T" - } - ] - } + "end": { + "line": 1, + "column": 8 + } + }, + "name": "T" + } + ] } } ] diff --git a/test/fixtures/flow/type-annotations/27/expected.json b/test/fixtures/flow/type-annotations/27/expected.json index 7e23e4be3b..71c96e968a 100644 --- a/test/fixtures/flow/type-annotations/27/expected.json +++ b/test/fixtures/flow/type-annotations/27/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 11, "end": 38, "loc": { @@ -107,88 +107,74 @@ }, "static": false, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 22, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 22 + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } }, - "end": { - "line": 1, - "column": 38 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 23, + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 28, "end": 35, "loc": { "start": { "line": 1, - "column": 23 + "column": 28 }, "end": { "line": 1, "column": 35 } }, - "name": "value", "typeAnnotation": { - "type": "TypeAnnotation", - "start": 28, + "type": "NumberTypeAnnotation", + "start": 29, "end": 35, "loc": { "start": { "line": 1, - "column": 28 + "column": 29 }, "end": { "line": 1, "column": 35 } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } } } } - ], - "body": { - "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "body": [], - "directives": [] } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/28/expected.json b/test/fixtures/flow/type-annotations/28/expected.json index 23a7b26c0b..ba9b916990 100644 --- a/test/fixtures/flow/type-annotations/28/expected.json +++ b/test/fixtures/flow/type-annotations/28/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 11, "end": 43, "loc": { @@ -107,118 +107,104 @@ }, "static": false, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 22, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 22 + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } }, - "end": { - "line": 1, - "column": 43 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 23, + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 28, "end": 35, "loc": { "start": { "line": 1, - "column": 23 + "column": 28 }, "end": { "line": 1, "column": 35 } }, - "name": "value", "typeAnnotation": { - "type": "TypeAnnotation", - "start": 28, + "type": "NumberTypeAnnotation", + "start": 29, "end": 35, "loc": { "start": { "line": 1, - "column": 28 + "column": 29 }, "end": { "line": 1, "column": 35 } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } } } } - ], - "returnType": { - "type": "TypeAnnotation", - "start": 36, + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "typeAnnotation": { + "type": "VoidTypeAnnotation", + "start": 37, "end": 41, "loc": { "start": { "line": 1, - "column": 36 + "column": 37 }, "end": { "line": 1, "column": 41 } - }, - "typeAnnotation": { - "type": "VoidTypeAnnotation", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 41 - } - } } - }, - "body": { - "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 43 - } - }, - "body": [], - "directives": [] } + }, + "body": { + "type": "BlockStatement", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/29/expected.json b/test/fixtures/flow/type-annotations/29/expected.json index 69dab292da..b675422aca 100644 --- a/test/fixtures/flow/type-annotations/29/expected.json +++ b/test/fixtures/flow/type-annotations/29/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 11, "end": 33, "loc": { @@ -107,71 +107,57 @@ }, "static": false, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 22, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 24, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + } + } + }, + "body": { + "type": "BlockStatement", + "start": 31, "end": 33, "loc": { "start": { "line": 1, - "column": 22 + "column": 31 }, "end": { "line": 1, "column": 33 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "returnType": { - "type": "TypeAnnotation", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - }, - "body": { - "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/50/expected.json b/test/fixtures/flow/type-annotations/50/expected.json index 84759bfbc6..836b93e825 100644 --- a/test/fixtures/flow/type-annotations/50/expected.json +++ b/test/fixtures/flow/type-annotations/50/expected.json @@ -108,7 +108,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 15, "end": 45, "loc": { @@ -140,140 +140,126 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 21, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "U" + } + ] + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 23, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + } + } + }, + "body": { + "type": "BlockStatement", + "start": 31, "end": 45, "loc": { "start": { "line": 1, - "column": 21 + "column": 31 }, "end": { "line": 1, "column": 45 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "returnType": { - "type": "TypeAnnotation", - "start": 23, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 24, - "end": 30, + "body": [ + { + "type": "ReturnStatement", + "start": 33, + "end": 43, "loc": { "start": { "line": 1, - "column": 24 + "column": 33 }, "end": { "line": 1, - "column": 30 + "column": 43 } + }, + "argument": { + "type": "NumberLiteral", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 } } - }, - "body": { - "type": "BlockStatement", - "start": 31, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 45 - } - }, - "body": [ - { - "type": "ReturnStatement", - "start": 33, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 43 - } - }, - "argument": { - "type": "NumberLiteral", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "extra": { - "rawValue": 42, - "raw": "42" - }, - "value": 42 - } - } - ], - "directives": [] - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "params": [ - { - "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "name": "U" - } - ] - } + ], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/51/expected.json b/test/fixtures/flow/type-annotations/51/expected.json index be9240f72e..225c2d3596 100644 --- a/test/fixtures/flow/type-annotations/51/expected.json +++ b/test/fixtures/flow/type-annotations/51/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 12, "end": 26, "loc": { @@ -111,74 +111,60 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 20, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "params": [ + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "T" + } + ] + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, "end": 26, "loc": { "start": { "line": 1, - "column": 20 + "column": 23 }, "end": { "line": 1, "column": 26 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "body": [], - "directives": [] - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "params": [ - { - "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "name": "T" - } - ] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/56/expected.json b/test/fixtures/flow/type-annotations/56/expected.json index ac710d4778..91bd2b0584 100644 --- a/test/fixtures/flow/type-annotations/56/expected.json +++ b/test/fixtures/flow/type-annotations/56/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 14, "end": 46, "loc": { @@ -107,120 +107,106 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 20, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 20 + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 21, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 42 + } }, - "end": { - "line": 1, - "column": 46 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 21, + "name": "items", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 26, "end": 42, "loc": { "start": { "line": 1, - "column": 21 + "column": 26 }, "end": { "line": 1, "column": 42 } }, - "name": "items", "typeAnnotation": { - "type": "TypeAnnotation", - "start": 26, + "type": "UnionTypeAnnotation", + "start": 27, "end": 42, "loc": { "start": { "line": 1, - "column": 26 + "column": 27 }, "end": { "line": 1, "column": 42 } }, - "typeAnnotation": { - "type": "UnionTypeAnnotation", - "start": 27, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 42 + "types": [ + { + "type": "NumberTypeAnnotation", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 33 + } } }, - "types": [ - { - "type": "NumberTypeAnnotation", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - { - "type": "StringTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } + { + "type": "StringTypeAnnotation", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 } } - ] - } + } + ] } } - ], - "body": { - "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 46 - } - }, - "body": [], - "directives": [] } + ], + "body": { + "type": "BlockStatement", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/flow/type-annotations/60/expected.json b/test/fixtures/flow/type-annotations/60/expected.json index 69d4f65178..a2db556539 100644 --- a/test/fixtures/flow/type-annotations/60/expected.json +++ b/test/fixtures/flow/type-annotations/60/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 6, "loc": { @@ -105,7 +105,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, @@ -222,7 +221,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 27, "end": 37, "loc": { @@ -273,8 +272,7 @@ "raw": "\"hello\"" }, "value": "hello" - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/flow/type-annotations/61/expected.json b/test/fixtures/flow/type-annotations/61/expected.json index c09b9c0fec..b4cdb54e7d 100644 --- a/test/fixtures/flow/type-annotations/61/expected.json +++ b/test/fixtures/flow/type-annotations/61/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 6, "loc": { @@ -105,7 +105,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, @@ -222,7 +221,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 26, "end": 36, "loc": { @@ -273,8 +272,7 @@ "raw": "\"hello\"" }, "value": "hello" - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/flow/type-annotations/63/expected.json b/test/fixtures/flow/type-annotations/63/expected.json index c67a31a154..55cd213628 100644 --- a/test/fixtures/flow/type-annotations/63/expected.json +++ b/test/fixtures/flow/type-annotations/63/expected.json @@ -60,6 +60,7 @@ }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -77,7 +78,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 14, "end": 15, "loc": { @@ -109,7 +110,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 14, diff --git a/test/fixtures/flow/type-annotations/97/expected.json b/test/fixtures/flow/type-annotations/97/expected.json index ad6352b9a0..b6a11dc752 100644 --- a/test/fixtures/flow/type-annotations/97/expected.json +++ b/test/fixtures/flow/type-annotations/97/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 22, "loc": { @@ -107,6 +107,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "typeParameters": { "type": "TypeParameterDeclaration", "start": 14, @@ -158,8 +159,7 @@ "body": [], "directives": [] } - }, - "kind": "init" + } } ], "extra": { diff --git a/test/fixtures/flow/typecasts/2/expected.json b/test/fixtures/flow/typecasts/2/expected.json index 48639097eb..79b652ae59 100644 --- a/test/fixtures/flow/typecasts/2/expected.json +++ b/test/fixtures/flow/typecasts/2/expected.json @@ -72,7 +72,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 8, "loc": { @@ -123,11 +123,10 @@ "raw": "0" }, "value": 0 - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 10, "end": 20, "loc": { @@ -178,8 +177,7 @@ "raw": "\"hey\"" }, "value": "hey" - }, - "kind": "init" + } } ] }, diff --git a/test/fixtures/harmony/computed-properties/call-expression/expected.json b/test/fixtures/harmony/computed-properties/call-expression/expected.json index df195bb3a8..6a6f627eec 100644 --- a/test/fixtures/harmony/computed-properties/call-expression/expected.json +++ b/test/fixtures/harmony/computed-properties/call-expression/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 14, "end": 25, "loc": { @@ -156,8 +156,7 @@ "raw": "\"\"" }, "value": "" - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/harmony/uncategorised/191/actual.js b/test/fixtures/harmony/uncategorised/.191/actual.js similarity index 100% rename from test/fixtures/harmony/uncategorised/191/actual.js rename to test/fixtures/harmony/uncategorised/.191/actual.js diff --git a/test/fixtures/harmony/uncategorised/191/expected.json b/test/fixtures/harmony/uncategorised/.191/expected.json similarity index 100% rename from test/fixtures/harmony/uncategorised/191/expected.json rename to test/fixtures/harmony/uncategorised/.191/expected.json diff --git a/test/fixtures/harmony/uncategorised/260/actual.js b/test/fixtures/harmony/uncategorised/.260/actual.js similarity index 100% rename from test/fixtures/harmony/uncategorised/260/actual.js rename to test/fixtures/harmony/uncategorised/.260/actual.js diff --git a/test/fixtures/harmony/uncategorised/260/options.json b/test/fixtures/harmony/uncategorised/.260/options.json similarity index 100% rename from test/fixtures/harmony/uncategorised/260/options.json rename to test/fixtures/harmony/uncategorised/.260/options.json diff --git a/test/fixtures/harmony/uncategorised/335/actual.js b/test/fixtures/harmony/uncategorised/.335/actual.js similarity index 100% rename from test/fixtures/harmony/uncategorised/335/actual.js rename to test/fixtures/harmony/uncategorised/.335/actual.js diff --git a/test/fixtures/harmony/uncategorised/335/expected.json b/test/fixtures/harmony/uncategorised/.335/expected.json similarity index 100% rename from test/fixtures/harmony/uncategorised/335/expected.json rename to test/fixtures/harmony/uncategorised/.335/expected.json diff --git a/test/fixtures/harmony/uncategorised/335/options.json b/test/fixtures/harmony/uncategorised/.335/options.json similarity index 100% rename from test/fixtures/harmony/uncategorised/335/options.json rename to test/fixtures/harmony/uncategorised/.335/options.json diff --git a/test/fixtures/harmony/uncategorised/343/actual.js b/test/fixtures/harmony/uncategorised/.343/actual.js similarity index 100% rename from test/fixtures/harmony/uncategorised/343/actual.js rename to test/fixtures/harmony/uncategorised/.343/actual.js diff --git a/test/fixtures/harmony/uncategorised/343/expected.json b/test/fixtures/harmony/uncategorised/.343/expected.json similarity index 100% rename from test/fixtures/harmony/uncategorised/343/expected.json rename to test/fixtures/harmony/uncategorised/.343/expected.json diff --git a/test/fixtures/harmony/uncategorised/343/options.json b/test/fixtures/harmony/uncategorised/.343/options.json similarity index 100% rename from test/fixtures/harmony/uncategorised/343/options.json rename to test/fixtures/harmony/uncategorised/.343/options.json diff --git a/test/fixtures/harmony/uncategorised/345/actual.js b/test/fixtures/harmony/uncategorised/.345/actual.js similarity index 100% rename from test/fixtures/harmony/uncategorised/345/actual.js rename to test/fixtures/harmony/uncategorised/.345/actual.js diff --git a/test/fixtures/harmony/uncategorised/345/options.json b/test/fixtures/harmony/uncategorised/.345/options.json similarity index 100% rename from test/fixtures/harmony/uncategorised/345/options.json rename to test/fixtures/harmony/uncategorised/.345/options.json diff --git a/test/fixtures/harmony/uncategorised/346/actual.js b/test/fixtures/harmony/uncategorised/.346/actual.js similarity index 100% rename from test/fixtures/harmony/uncategorised/346/actual.js rename to test/fixtures/harmony/uncategorised/.346/actual.js diff --git a/test/fixtures/harmony/uncategorised/346/options.json b/test/fixtures/harmony/uncategorised/.346/options.json similarity index 100% rename from test/fixtures/harmony/uncategorised/346/options.json rename to test/fixtures/harmony/uncategorised/.346/options.json diff --git a/test/fixtures/harmony/uncategorised/348/actual.js b/test/fixtures/harmony/uncategorised/.348/actual.js similarity index 100% rename from test/fixtures/harmony/uncategorised/348/actual.js rename to test/fixtures/harmony/uncategorised/.348/actual.js diff --git a/test/fixtures/harmony/uncategorised/.348/expected.json b/test/fixtures/harmony/uncategorised/.348/expected.json new file mode 100644 index 0000000000..a90d6d7108 --- /dev/null +++ b/test/fixtures/harmony/uncategorised/.348/expected.json @@ -0,0 +1,177 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "__proto__" + }, + "value": { + "type": "NumberLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ObjectProperty", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "__proto__" + }, + "value": { + "type": "NumberLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "extra": { + "parenthesized": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/348/options.json b/test/fixtures/harmony/uncategorised/.348/options.json similarity index 100% rename from test/fixtures/harmony/uncategorised/348/options.json rename to test/fixtures/harmony/uncategorised/.348/options.json diff --git a/test/fixtures/harmony/uncategorised/349/actual.js b/test/fixtures/harmony/uncategorised/.349/actual.js similarity index 100% rename from test/fixtures/harmony/uncategorised/349/actual.js rename to test/fixtures/harmony/uncategorised/.349/actual.js diff --git a/test/fixtures/harmony/uncategorised/349/expected.json b/test/fixtures/harmony/uncategorised/.349/expected.json similarity index 100% rename from test/fixtures/harmony/uncategorised/349/expected.json rename to test/fixtures/harmony/uncategorised/.349/expected.json diff --git a/test/fixtures/harmony/uncategorised/349/options.json b/test/fixtures/harmony/uncategorised/.349/options.json similarity index 100% rename from test/fixtures/harmony/uncategorised/349/options.json rename to test/fixtures/harmony/uncategorised/.349/options.json diff --git a/test/fixtures/harmony/uncategorised/353/actual.js b/test/fixtures/harmony/uncategorised/.353/actual.js similarity index 100% rename from test/fixtures/harmony/uncategorised/353/actual.js rename to test/fixtures/harmony/uncategorised/.353/actual.js diff --git a/test/fixtures/harmony/uncategorised/353/expected.json b/test/fixtures/harmony/uncategorised/.353/expected.json similarity index 100% rename from test/fixtures/harmony/uncategorised/353/expected.json rename to test/fixtures/harmony/uncategorised/.353/expected.json diff --git a/test/fixtures/harmony/uncategorised/353/options.json b/test/fixtures/harmony/uncategorised/.353/options.json similarity index 100% rename from test/fixtures/harmony/uncategorised/353/options.json rename to test/fixtures/harmony/uncategorised/.353/options.json diff --git a/test/fixtures/harmony/uncategorised/103/expected.json b/test/fixtures/harmony/uncategorised/103/expected.json index 609ce0d37a..1397cc5c38 100644 --- a/test/fixtures/harmony/uncategorised/103/expected.json +++ b/test/fixtures/harmony/uncategorised/103/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 10, "end": 31, "loc": { @@ -121,42 +121,42 @@ }, "name": "test" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 16, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, "end": 31, "loc": { "start": { "line": 1, - "column": 16 + "column": 19 }, "end": { "line": 1, "column": 31 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } }, - "end": { - "line": 1, - "column": 31 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "YieldExpression", "start": 21, "end": 29, "loc": { @@ -169,41 +169,27 @@ "column": 29 } }, - "expression": { - "type": "YieldExpression", - "start": 21, + "delegate": true, + "argument": { + "type": "Identifier", + "start": 28, "end": 29, "loc": { "start": { "line": 1, - "column": 21 + "column": 28 }, "end": { "line": 1, "column": 29 } }, - "delegate": true, - "argument": { - "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "name": "v" - } + "name": "v" } } - ] - } + } + ], + "directives": [] } } ] @@ -212,7 +198,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/113/expected.json b/test/fixtures/harmony/uncategorised/113/expected.json index 937612426b..d5b033e029 100644 --- a/test/fixtures/harmony/uncategorised/113/expected.json +++ b/test/fixtures/harmony/uncategorised/113/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 17, "loc": { @@ -107,46 +107,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 12, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, "end": 17, "loc": { "start": { "line": 1, - "column": 12 + "column": 15 }, "end": { "line": 1, "column": 17 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/114/expected.json b/test/fixtures/harmony/uncategorised/114/expected.json index 2161c2d0ee..6601d59d6d 100644 --- a/test/fixtures/harmony/uncategorised/114/expected.json +++ b/test/fixtures/harmony/uncategorised/114/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 25, "loc": { @@ -107,46 +107,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 20, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, "end": 25, "loc": { "start": { "line": 1, - "column": 20 + "column": 23 }, "end": { "line": 1, "column": 25 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/115/expected.json b/test/fixtures/harmony/uncategorised/115/expected.json index 9b6a05da2a..75c400a2a7 100644 --- a/test/fixtures/harmony/uncategorised/115/expected.json +++ b/test/fixtures/harmony/uncategorised/115/expected.json @@ -90,7 +90,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 19, "end": 31, "loc": { @@ -122,46 +122,32 @@ }, "static": false, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 26, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, "end": 31, "loc": { "start": { "line": 1, - "column": 26 + "column": 29 }, "end": { "line": 1, "column": 31 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/116/expected.json b/test/fixtures/harmony/uncategorised/116/expected.json index 787e636554..c3fa277a2f 100644 --- a/test/fixtures/harmony/uncategorised/116/expected.json +++ b/test/fixtures/harmony/uncategorised/116/expected.json @@ -90,7 +90,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 20, "end": 39, "loc": { @@ -122,46 +122,32 @@ }, "static": true, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 34, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 37, "end": 39, "loc": { "start": { "line": 1, - "column": 34 + "column": 37 }, "end": { "line": 1, "column": 39 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/117/expected.json b/test/fixtures/harmony/uncategorised/117/expected.json index 0a4f8836f9..d607a58aad 100644 --- a/test/fixtures/harmony/uncategorised/117/expected.json +++ b/test/fixtures/harmony/uncategorised/117/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 20, "loc": { @@ -107,63 +107,49 @@ }, "static": false, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 14, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, "end": 20, "loc": { "start": { "line": 1, - "column": 14 + "column": 18 }, "end": { "line": 1, "column": 20 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/118/expected.json b/test/fixtures/harmony/uncategorised/118/expected.json index 58a55c8a4c..54e7adf346 100644 --- a/test/fixtures/harmony/uncategorised/118/expected.json +++ b/test/fixtures/harmony/uncategorised/118/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 28, "loc": { @@ -107,63 +107,49 @@ }, "static": true, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 22, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 26, "end": 28, "loc": { "start": { "line": 1, - "column": 22 + "column": 26 }, "end": { "line": 1, "column": 28 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/119/expected.json b/test/fixtures/harmony/uncategorised/119/expected.json index e8659d9d1a..e47c5c6942 100644 --- a/test/fixtures/harmony/uncategorised/119/expected.json +++ b/test/fixtures/harmony/uncategorised/119/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 18, "loc": { @@ -107,63 +107,49 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 12, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, "end": 18, "loc": { "start": { "line": 1, - "column": 12 + "column": 16 }, "end": { "line": 1, "column": 18 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/120/expected.json b/test/fixtures/harmony/uncategorised/120/expected.json index 4cbc7e1ce5..873df88c9f 100644 --- a/test/fixtures/harmony/uncategorised/120/expected.json +++ b/test/fixtures/harmony/uncategorised/120/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 26, "loc": { @@ -107,63 +107,49 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 20, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 24, "end": 26, "loc": { "start": { "line": 1, - "column": 20 + "column": 24 }, "end": { "line": 1, "column": 26 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/121/expected.json b/test/fixtures/harmony/uncategorised/121/expected.json index ae61f95fb4..f1e8a83082 100644 --- a/test/fixtures/harmony/uncategorised/121/expected.json +++ b/test/fixtures/harmony/uncategorised/121/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 29, "loc": { @@ -107,60 +107,60 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 13, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, "end": 29, "loc": { "start": { "line": 1, - "column": 13 + "column": 17 }, "end": { "line": 1, "column": 29 } }, - "id": null, - "generator": true, - "expression": false, - "params": [ + "body": [ { - "type": "Identifier", - "start": 14, - "end": 15, + "type": "ExpressionStatement", + "start": 19, + "end": 27, "loc": { "start": { "line": 1, - "column": 14 + "column": 19 }, "end": { "line": 1, - "column": 15 + "column": 27 } }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "YieldExpression", "start": 19, - "end": 27, + "end": 26, "loc": { "start": { "line": 1, @@ -168,50 +168,36 @@ }, "end": { "line": 1, - "column": 27 + "column": 26 } }, - "expression": { - "type": "YieldExpression", - "start": 19, + "delegate": false, + "argument": { + "type": "Identifier", + "start": 25, "end": 26, "loc": { "start": { "line": 1, - "column": 19 + "column": 25 }, "end": { "line": 1, "column": 26 } }, - "delegate": false, - "argument": { - "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "name": "v" - } + "name": "v" } } - ] - } + } + ], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/122/expected.json b/test/fixtures/harmony/uncategorised/122/expected.json index 305a0a44a9..0c6728f1b8 100644 --- a/test/fixtures/harmony/uncategorised/122/expected.json +++ b/test/fixtures/harmony/uncategorised/122/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 37, "loc": { @@ -107,60 +107,60 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 21, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 25, "end": 37, "loc": { "start": { "line": 1, - "column": 21 + "column": 25 }, "end": { "line": 1, "column": 37 } }, - "id": null, - "generator": true, - "expression": false, - "params": [ + "body": [ { - "type": "Identifier", - "start": 22, - "end": 23, + "type": "ExpressionStatement", + "start": 27, + "end": 35, "loc": { "start": { "line": 1, - "column": 22 + "column": 27 }, "end": { "line": 1, - "column": 23 + "column": 35 } }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "YieldExpression", "start": 27, - "end": 35, + "end": 34, "loc": { "start": { "line": 1, @@ -168,50 +168,36 @@ }, "end": { "line": 1, - "column": 35 + "column": 34 } }, - "expression": { - "type": "YieldExpression", - "start": 27, + "delegate": false, + "argument": { + "type": "Identifier", + "start": 33, "end": 34, "loc": { "start": { "line": 1, - "column": 27 + "column": 33 }, "end": { "line": 1, "column": 34 } }, - "delegate": false, - "argument": { - "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - }, - "name": "v" - } + "name": "v" } } - ] - } + } + ], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/123/expected.json b/test/fixtures/harmony/uncategorised/123/expected.json index 83a2d03682..2b8ddddaf7 100644 --- a/test/fixtures/harmony/uncategorised/123/expected.json +++ b/test/fixtures/harmony/uncategorised/123/expected.json @@ -89,7 +89,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 24, "end": 49, "loc": { @@ -121,41 +121,41 @@ }, "static": false, "kind": "constructor", - "value": { - "type": "FunctionExpression", - "start": 35, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, "end": 49, "loc": { "start": { "line": 1, - "column": 35 + "column": 38 }, "end": { "line": 1, "column": 49 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 38, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 38 + "body": [ + { + "type": "ExpressionStatement", + "start": 40, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 47 + } }, - "end": { - "line": 1, - "column": 49 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", "start": 40, "end": 47, "loc": { @@ -168,10 +168,10 @@ "column": 47 } }, - "expression": { - "type": "CallExpression", + "callee": { + "type": "Super", "start": 40, - "end": 47, + "end": 45, "loc": { "start": { "line": 1, @@ -179,30 +179,15 @@ }, "end": { "line": 1, - "column": 47 + "column": 45 } - }, - "callee": { - "type": "Super", - "start": 40, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 45 - } - } - }, - "arguments": [] - } + } + }, + "arguments": [] } - ], - "directives": [] - } + } + ], + "directives": [] } } ] diff --git a/test/fixtures/harmony/uncategorised/124/expected.json b/test/fixtures/harmony/uncategorised/124/expected.json index b3af6621a1..7c01cad6f1 100644 --- a/test/fixtures/harmony/uncategorised/124/expected.json +++ b/test/fixtures/harmony/uncategorised/124/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 27, "loc": { @@ -111,41 +111,26 @@ }, "static": false, "kind": "constructor", - "value": { - "type": "FunctionExpression", - "start": 22, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, "end": 27, "loc": { "start": { "line": 1, - "column": 22 + "column": 25 }, "end": { "line": 1, "column": 27 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/harmony/uncategorised/128/expected.json b/test/fixtures/harmony/uncategorised/128/expected.json index fe353f8bba..937272b468 100644 --- a/test/fixtures/harmony/uncategorised/128/expected.json +++ b/test/fixtures/harmony/uncategorised/128/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 24, "loc": { @@ -107,46 +107,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 19, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, "end": 24, "loc": { "start": { "line": 1, - "column": 19 + "column": 22 }, "end": { "line": 1, "column": 24 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/129/expected.json b/test/fixtures/harmony/uncategorised/129/expected.json index 6e71914af1..bb30c8aa84 100644 --- a/test/fixtures/harmony/uncategorised/129/expected.json +++ b/test/fixtures/harmony/uncategorised/129/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 17, "loc": { @@ -107,44 +107,30 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 12, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, "end": 17, "loc": { "start": { "line": 1, - "column": 12 + "column": 15 }, "end": { "line": 1, "column": 17 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 18, "end": 33, "loc": { @@ -176,46 +162,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 28, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, "end": 33, "loc": { "start": { "line": 1, - "column": 28 + "column": 31 }, "end": { "line": 1, "column": 33 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/130/actual.js b/test/fixtures/harmony/uncategorised/130/actual.js deleted file mode 100644 index 42108ece49..0000000000 --- a/test/fixtures/harmony/uncategorised/130/actual.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; (class A { static constructor() { super() }}) \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/130/expected.json b/test/fixtures/harmony/uncategorised/130/expected.json deleted file mode 100644 index 19d9b17be0..0000000000 --- a/test/fixtures/harmony/uncategorised/130/expected.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 14, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 59 - } - }, - "expression": { - "type": "ClassExpression", - "start": 15, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 58 - } - }, - "id": { - "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "name": "A" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 23, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 58 - } - }, - "body": [ - { - "type": "MethodDefinition", - "start": 25, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 57 - } - }, - "computed": false, - "key": { - "type": "Identifier", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, - "name": "constructor" - }, - "static": true, - "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 43, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 57 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 46, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 57 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 55 - } - }, - "expression": { - "type": "CallExpression", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 55 - } - }, - "callee": { - "type": "Super", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "arguments": [] - } - } - ], - "directives": [] - } - } - } - ] - }, - "extra": { - "parenthesized": true - } - } - } - ], - "directives": [ - { - "type": "Directive", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "value": { - "type": "DirectiveLiteral", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "value": "use strict", - "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/131/expected.json b/test/fixtures/harmony/uncategorised/131/expected.json index ee42e3d61e..8c38e200c5 100644 --- a/test/fixtures/harmony/uncategorised/131/expected.json +++ b/test/fixtures/harmony/uncategorised/131/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 18, "loc": { @@ -107,44 +107,30 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 13, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, "end": 18, "loc": { "start": { "line": 1, - "column": 13 + "column": 16 }, "end": { "line": 1, "column": 18 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 19, "end": 27, "loc": { @@ -176,46 +162,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 22, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, "end": 27, "loc": { "start": { "line": 1, - "column": 22 + "column": 25 }, "end": { "line": 1, "column": 27 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/132/expected.json b/test/fixtures/harmony/uncategorised/132/expected.json index 1cdc2db117..7468edee54 100644 --- a/test/fixtures/harmony/uncategorised/132/expected.json +++ b/test/fixtures/harmony/uncategorised/132/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 22, "loc": { @@ -107,44 +107,30 @@ }, "static": false, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 17, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, "end": 22, "loc": { "start": { "line": 1, - "column": 17 + "column": 20 }, "end": { "line": 1, "column": 22 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 23, "end": 36, "loc": { @@ -176,63 +162,49 @@ }, "static": false, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 30, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 34, "end": 36, "loc": { "start": { "line": 1, - "column": 30 + "column": 34 }, "end": { "line": 1, "column": 36 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/133/expected.json b/test/fixtures/harmony/uncategorised/133/expected.json index 5c02d2eecd..7e8a2075c5 100644 --- a/test/fixtures/harmony/uncategorised/133/expected.json +++ b/test/fixtures/harmony/uncategorised/133/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 29, "loc": { @@ -107,44 +107,30 @@ }, "static": true, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 24, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, "end": 29, "loc": { "start": { "line": 1, - "column": 24 + "column": 27 }, "end": { "line": 1, "column": 29 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 30, "end": 42, "loc": { @@ -176,46 +162,32 @@ }, "static": false, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 37, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 40, "end": 42, "loc": { "start": { "line": 1, - "column": 37 + "column": 40 }, "end": { "line": 1, "column": 42 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/134/expected.json b/test/fixtures/harmony/uncategorised/134/expected.json index 7254b30243..d81ed33228 100644 --- a/test/fixtures/harmony/uncategorised/134/expected.json +++ b/test/fixtures/harmony/uncategorised/134/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 29, "loc": { @@ -107,44 +107,30 @@ }, "static": true, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 24, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, "end": 29, "loc": { "start": { "line": 1, - "column": 24 + "column": 27 }, "end": { "line": 1, "column": 29 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 30, "end": 49, "loc": { @@ -176,46 +162,32 @@ }, "static": true, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 44, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 47, "end": 49, "loc": { "start": { "line": 1, - "column": 44 + "column": 47 }, "end": { "line": 1, "column": 49 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 49 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/135/expected.json b/test/fixtures/harmony/uncategorised/135/expected.json index 0b1130de7c..834c4dccf7 100644 --- a/test/fixtures/harmony/uncategorised/135/expected.json +++ b/test/fixtures/harmony/uncategorised/135/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 29, "loc": { @@ -107,44 +107,30 @@ }, "static": true, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 24, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, "end": 29, "loc": { "start": { "line": 1, - "column": 24 + "column": 27 }, "end": { "line": 1, "column": 29 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 30, "end": 50, "loc": { @@ -176,61 +162,47 @@ }, "static": true, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 44, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 48, "end": 50, "loc": { "start": { "line": 1, - "column": 44 + "column": 48 }, "end": { "line": 1, "column": 50 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - } - }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 50 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 51, "end": 63, "loc": { @@ -262,44 +234,30 @@ }, "static": false, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 58, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 61, "end": 63, "loc": { "start": { "line": 1, - "column": 58 + "column": 61 }, "end": { "line": 1, "column": 63 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 61, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 63 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 64, "end": 77, "loc": { @@ -331,63 +289,49 @@ }, "static": false, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 71, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 72, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 72 + }, + "end": { + "line": 1, + "column": 73 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 75, "end": 77, "loc": { "start": { "line": 1, - "column": 71 + "column": 75 }, "end": { "line": 1, "column": 77 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 72, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 72 - }, - "end": { - "line": 1, - "column": 73 - } - }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 75, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 75 - }, - "end": { - "line": 1, - "column": 77 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/136/expected.json b/test/fixtures/harmony/uncategorised/136/expected.json index 2e0cf52943..22216e8a4d 100644 --- a/test/fixtures/harmony/uncategorised/136/expected.json +++ b/test/fixtures/harmony/uncategorised/136/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 27, "loc": { @@ -107,46 +107,32 @@ }, "static": true, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 22, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, "end": 27, "loc": { "start": { "line": 1, - "column": 22 + "column": 25 }, "end": { "line": 1, "column": 27 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/137/expected.json b/test/fixtures/harmony/uncategorised/137/expected.json index 81860c95fb..379914b948 100644 --- a/test/fixtures/harmony/uncategorised/137/expected.json +++ b/test/fixtures/harmony/uncategorised/137/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 31, "loc": { @@ -107,46 +107,32 @@ }, "static": true, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 26, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, "end": 31, "loc": { "start": { "line": 1, - "column": 26 + "column": 29 }, "end": { "line": 1, "column": 31 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/138/expected.json b/test/fixtures/harmony/uncategorised/138/expected.json index dec1437174..36e95c1207 100644 --- a/test/fixtures/harmony/uncategorised/138/expected.json +++ b/test/fixtures/harmony/uncategorised/138/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 23, "loc": { @@ -107,61 +107,47 @@ }, "static": false, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 17, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, "end": 23, "loc": { "start": { "line": 1, - "column": 17 + "column": 21 }, "end": { "line": 1, "column": 23 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 24, "end": 36, "loc": { @@ -193,46 +179,32 @@ }, "static": false, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 31, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, "end": 36, "loc": { "start": { "line": 1, - "column": 31 + "column": 34 }, "end": { "line": 1, "column": 36 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/139/expected.json b/test/fixtures/harmony/uncategorised/139/expected.json index bde2d7b1d9..ada61eb661 100644 --- a/test/fixtures/harmony/uncategorised/139/expected.json +++ b/test/fixtures/harmony/uncategorised/139/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 18, "loc": { @@ -107,44 +107,30 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 13, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, "end": 18, "loc": { "start": { "line": 1, - "column": 13 + "column": 16 }, "end": { "line": 1, "column": 18 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "body": [] - } + "body": [], + "directives": [] } }, { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 19, "end": 31, "loc": { @@ -176,46 +162,32 @@ }, "static": false, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 26, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, "end": 31, "loc": { "start": { "line": 1, - "column": 26 + "column": 29 }, "end": { "line": 1, "column": 31 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/141/expected.json b/test/fixtures/harmony/uncategorised/141/expected.json index 9c4ce67855..fe8be3d209 100644 --- a/test/fixtures/harmony/uncategorised/141/expected.json +++ b/test/fixtures/harmony/uncategorised/141/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 9, "loc": { @@ -109,8 +109,7 @@ "raw": "10" }, "value": 10 - }, - "kind": "init" + } } ], "extra": { diff --git a/test/fixtures/harmony/uncategorised/142/expected.json b/test/fixtures/harmony/uncategorised/142/expected.json index 6198ec9aa5..83f683e3eb 100644 --- a/test/fixtures/harmony/uncategorised/142/expected.json +++ b/test/fixtures/harmony/uncategorised/142/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 17, "loc": { @@ -149,8 +149,7 @@ "raw": "10" }, "value": 10 - }, - "kind": "init" + } } ], "extra": { diff --git a/test/fixtures/harmony/uncategorised/143/expected.json b/test/fixtures/harmony/uncategorised/143/expected.json index 01caab9e66..cc0ab8afc8 100644 --- a/test/fixtures/harmony/uncategorised/143/expected.json +++ b/test/fixtures/harmony/uncategorised/143/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 20, "loc": { @@ -125,8 +125,7 @@ "body": [], "directives": [] } - }, - "kind": "init" + } } ], "extra": { diff --git a/test/fixtures/harmony/uncategorised/144/expected.json b/test/fixtures/harmony/uncategorised/144/expected.json index 25f8cb97cc..c054f5cc59 100644 --- a/test/fixtures/harmony/uncategorised/144/expected.json +++ b/test/fixtures/harmony/uncategorised/144/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 9, "loc": { @@ -109,11 +109,10 @@ "raw": "10" }, "value": 10 - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 11, "end": 16, "loc": { @@ -164,8 +163,7 @@ "raw": "20" }, "value": 20 - }, - "kind": "init" + } } ], "extra": { diff --git a/test/fixtures/harmony/uncategorised/145/expected.json b/test/fixtures/harmony/uncategorised/145/expected.json index 89a62e0093..c87f359ecb 100644 --- a/test/fixtures/harmony/uncategorised/145/expected.json +++ b/test/fixtures/harmony/uncategorised/145/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 2, "end": 14, "loc": { @@ -91,45 +91,30 @@ "name": "x" }, "kind": "get", - "value": { - "type": "FunctionExpression", - "start": 9, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 14, "loc": { "start": { "line": 1, - "column": 9 + "column": 12 }, "end": { "line": 1, "column": 14 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } }, { - "type": "Property", + "type": "ObjectMethod", "start": 16, "end": 29, "loc": { @@ -162,58 +147,43 @@ "name": "x" }, "kind": "set", - "value": { - "type": "FunctionExpression", - "start": 23, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 27, "end": 29, "loc": { "start": { "line": 1, - "column": 23 + "column": 27 }, "end": { "line": 1, "column": 29 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "name": "v" - } - ], - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/harmony/uncategorised/146/expected.json b/test/fixtures/harmony/uncategorised/146/expected.json index 68e454ca7f..8ab9dd27fd 100644 --- a/test/fixtures/harmony/uncategorised/146/expected.json +++ b/test/fixtures/harmony/uncategorised/146/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 2, "end": 10, "loc": { @@ -90,42 +90,27 @@ }, "name": "x" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 5, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 8, "end": 10, "loc": { "start": { "line": 1, - "column": 5 + "column": 8 }, "end": { "line": 1, "column": 10 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/harmony/uncategorised/147/expected.json b/test/fixtures/harmony/uncategorised/147/expected.json index f4966b1c1f..e9263cf600 100644 --- a/test/fixtures/harmony/uncategorised/147/expected.json +++ b/test/fixtures/harmony/uncategorised/147/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 11, "loc": { @@ -120,8 +120,7 @@ } }, "name": "y" - }, - "kind": "init" + } } ] }, @@ -141,7 +140,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 16, "end": 17, "loc": { @@ -173,7 +172,6 @@ }, "name": "y" }, - "kind": "init", "value": { "type": "Identifier", "start": 16, @@ -197,7 +195,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/148/expected.json b/test/fixtures/harmony/uncategorised/148/expected.json index 35f50da821..c2c6fcf107 100644 --- a/test/fixtures/harmony/uncategorised/148/expected.json +++ b/test/fixtures/harmony/uncategorised/148/expected.json @@ -77,7 +77,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 12, "end": 18, "loc": { @@ -124,8 +124,7 @@ } }, "name": "y" - }, - "kind": "init" + } } ] } @@ -144,10 +143,11 @@ "column": 23 } }, - "body": [] + "body": [], + "directives": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/149/expected.json b/test/fixtures/harmony/uncategorised/149/expected.json index 622622b2ef..2b533c4b95 100644 --- a/test/fixtures/harmony/uncategorised/149/expected.json +++ b/test/fixtures/harmony/uncategorised/149/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 9, "end": 32, "loc": { @@ -121,44 +121,44 @@ }, "name": "test" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 16, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, "end": 32, "loc": { "start": { "line": 1, - "column": 16 + "column": 19 }, "end": { "line": 1, "column": 32 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 30 + } }, - "end": { - "line": 1, - "column": 32 - } - }, - "body": [ - { - "type": "ExpressionStatement", + "expression": { + "type": "YieldExpression", "start": 21, - "end": 30, + "end": 29, "loc": { "start": { "line": 1, @@ -166,44 +166,30 @@ }, "end": { "line": 1, - "column": 30 + "column": 29 } }, - "expression": { - "type": "YieldExpression", - "start": 21, + "delegate": true, + "argument": { + "type": "Identifier", + "start": 28, "end": 29, "loc": { "start": { "line": 1, - "column": 21 + "column": 28 }, "end": { "line": 1, "column": 29 } }, - "delegate": true, - "argument": { - "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "name": "v" - } + "name": "v" } } - ] - } + } + ], + "directives": [] } } ] @@ -212,7 +198,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/150/expected.json b/test/fixtures/harmony/uncategorised/150/expected.json index 8e36dcc558..77889bf067 100644 --- a/test/fixtures/harmony/uncategorised/150/expected.json +++ b/test/fixtures/harmony/uncategorised/150/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 9, "end": 17, "loc": { @@ -107,46 +107,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 12, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, "end": 17, "loc": { "start": { "line": 1, - "column": 12 + "column": 15 }, "end": { "line": 1, "column": 17 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/153/expected.json b/test/fixtures/harmony/uncategorised/153/expected.json index 5830686c0b..898db20cdc 100644 --- a/test/fixtures/harmony/uncategorised/153/expected.json +++ b/test/fixtures/harmony/uncategorised/153/expected.json @@ -91,7 +91,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 12, "end": 13, "loc": { @@ -123,7 +123,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 12, @@ -159,7 +158,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 18, "end": 23, "loc": { @@ -210,8 +209,7 @@ "raw": "10" }, "value": 10 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/harmony/uncategorised/154/expected.json b/test/fixtures/harmony/uncategorised/154/expected.json index c27822598f..00d6e9bd9a 100644 --- a/test/fixtures/harmony/uncategorised/154/expected.json +++ b/test/fixtures/harmony/uncategorised/154/expected.json @@ -121,7 +121,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 14, "end": 15, "loc": { @@ -153,7 +153,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 14, @@ -189,7 +188,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 20, "end": 25, "loc": { @@ -240,8 +239,7 @@ "raw": "10" }, "value": 10 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/harmony/uncategorised/155/expected.json b/test/fixtures/harmony/uncategorised/155/expected.json index 4892fdd837..648cc628d4 100644 --- a/test/fixtures/harmony/uncategorised/155/expected.json +++ b/test/fixtures/harmony/uncategorised/155/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 31, "loc": { @@ -138,7 +138,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 15, "end": 16, "loc": { @@ -170,7 +170,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 15, @@ -206,7 +205,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 21, "end": 26, "loc": { @@ -257,8 +256,7 @@ "raw": "10" }, "value": 10 - }, - "kind": "init" + } } ] } @@ -281,8 +279,7 @@ "body": [], "directives": [] } - }, - "kind": "init" + } } ], "extra": { diff --git a/test/fixtures/harmony/uncategorised/156/expected.json b/test/fixtures/harmony/uncategorised/156/expected.json index f918574a30..ff433a7001 100644 --- a/test/fixtures/harmony/uncategorised/156/expected.json +++ b/test/fixtures/harmony/uncategorised/156/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 2, "end": 21, "loc": { @@ -90,29 +90,29 @@ }, "name": "f" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 3, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 3 + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } }, - "end": { - "line": 1, - "column": 21 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", + "left": { + "type": "ObjectPattern", "start": 4, - "end": 17, + "end": 7, "loc": { "start": { "line": 1, @@ -120,26 +120,29 @@ }, "end": { "line": 1, - "column": 17 + "column": 7 } }, - "left": { - "type": "ObjectPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 + "properties": [ + { + "type": "ObjectProperty", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } }, - "end": { - "line": 1, - "column": 7 - } - }, - "properties": [ - { - "type": "Property", + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", "start": 5, "end": 6, "loc": { @@ -152,136 +155,116 @@ "column": 6 } }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "name": "x" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "name": "x" - } - } - ] - }, - "right": { - "type": "ObjectExpression", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 + "name": "x" }, - "end": { - "line": 1, - "column": 17 + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 }, - "properties": [ - { - "type": "Property", + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", "start": 11, - "end": 16, + "end": 12, "loc": { "start": { "line": 1, "column": 11 }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "value": { + "type": "NumberLiteral", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, "end": { "line": 1, "column": 16 } }, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "name": "x" + "extra": { + "rawValue": 10, + "raw": "10" }, - "value": { - "type": "NumberLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "extra": { - "rawValue": 10, - "raw": "10" - }, - "value": 10 - }, - "kind": "init" + "value": 10 } - ] - } + } + ] } - ], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "body": [], - "directives": [] } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/harmony/uncategorised/157/expected.json b/test/fixtures/harmony/uncategorised/157/expected.json index 519875cdd1..16c419f612 100644 --- a/test/fixtures/harmony/uncategorised/157/expected.json +++ b/test/fixtures/harmony/uncategorised/157/expected.json @@ -74,7 +74,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 8, "end": 27, "loc": { @@ -106,28 +106,28 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 10, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 23 + } }, - "end": { - "line": 1, - "column": 27 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", + "left": { + "type": "ObjectPattern", "start": 10, - "end": 23, + "end": 13, "loc": { "start": { "line": 1, @@ -135,26 +135,29 @@ }, "end": { "line": 1, - "column": 23 + "column": 13 } }, - "left": { - "type": "ObjectPattern", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 + "properties": [ + { + "type": "ObjectProperty", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } }, - "end": { - "line": 1, - "column": 13 - } - }, - "properties": [ - { - "type": "Property", + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", "start": 11, "end": 12, "loc": { @@ -167,136 +170,116 @@ "column": 12 } }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "name": "x" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "name": "x" - } - } - ] - }, - "right": { - "type": "ObjectExpression", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 + "name": "x" }, - "end": { - "line": 1, - "column": 23 + "value": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 }, - "properties": [ - { - "type": "Property", + "end": { + "line": 1, + "column": 23 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", "start": 17, - "end": 22, + "end": 18, "loc": { "start": { "line": 1, "column": 17 }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + }, + "value": { + "type": "NumberLiteral", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, "end": { "line": 1, "column": 22 } }, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "x" + "extra": { + "rawValue": 10, + "raw": "10" }, - "value": { - "type": "NumberLiteral", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "extra": { - "rawValue": 10, - "raw": "10" - }, - "value": 10 - }, - "kind": "init" + "value": 10 } - ] - } + } + ] } - ], - "body": { - "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "body": [], - "directives": [] } + ], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/harmony/uncategorised/158/expected.json b/test/fixtures/harmony/uncategorised/158/expected.json index 126c8430f4..f37f65a5de 100644 --- a/test/fixtures/harmony/uncategorised/158/expected.json +++ b/test/fixtures/harmony/uncategorised/158/expected.json @@ -90,7 +90,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 4, "loc": { @@ -122,7 +122,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 3, @@ -158,7 +157,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 9, "end": 14, "loc": { @@ -209,8 +208,7 @@ "raw": "10" }, "value": 10 - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/harmony/uncategorised/161/expected.json b/test/fixtures/harmony/uncategorised/161/expected.json index 0fdbc8a52e..64c3b49fae 100644 --- a/test/fixtures/harmony/uncategorised/161/expected.json +++ b/test/fixtures/harmony/uncategorised/161/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 25, "loc": { @@ -208,8 +208,7 @@ "body": [], "directives": [] } - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/harmony/uncategorised/162/expected.json b/test/fixtures/harmony/uncategorised/162/expected.json index 95a9a2ba3e..324d763163 100644 --- a/test/fixtures/harmony/uncategorised/162/expected.json +++ b/test/fixtures/harmony/uncategorised/162/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 15, "loc": { @@ -121,94 +121,79 @@ }, "name": "f" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } }, - "end": { - "line": 1, - "column": 15 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", + "left": { + "type": "Identifier", "start": 8, - "end": 11, + "end": 9, "loc": { "start": { "line": 1, "column": 8 }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "a" + }, + "right": { + "type": "NumberLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, "end": { "line": 1, "column": 11 } }, - "left": { - "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - }, - "name": "a" + "extra": { + "rawValue": 1, + "raw": "1" }, - "right": { - "type": "NumberLiteral", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - } + "value": 1 } - ], - "body": { - "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "body": [], - "directives": [] } + ], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/harmony/uncategorised/165/expected.json b/test/fixtures/harmony/uncategorised/165/expected.json index 4ba45288ad..08cb8d6662 100644 --- a/test/fixtures/harmony/uncategorised/165/expected.json +++ b/test/fixtures/harmony/uncategorised/165/expected.json @@ -77,7 +77,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 13, "end": 14, "loc": { @@ -109,7 +109,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 13, @@ -128,7 +127,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 16, "end": 17, "loc": { @@ -160,7 +159,6 @@ }, "name": "b" }, - "kind": "init", "value": { "type": "Identifier", "start": 16, @@ -195,10 +193,11 @@ "column": 22 } }, - "body": [] + "body": [], + "directives": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/166/expected.json b/test/fixtures/harmony/uncategorised/166/expected.json index 65c064b712..fecc14e44a 100644 --- a/test/fixtures/harmony/uncategorised/166/expected.json +++ b/test/fixtures/harmony/uncategorised/166/expected.json @@ -93,7 +93,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 16, "end": 17, "loc": { @@ -125,7 +125,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 16, @@ -160,10 +159,11 @@ "column": 22 } }, - "body": [] + "body": [], + "directives": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/170/expected.json b/test/fixtures/harmony/uncategorised/170/expected.json index 7d82cfb3bb..50b9811fd9 100644 --- a/test/fixtures/harmony/uncategorised/170/expected.json +++ b/test/fixtures/harmony/uncategorised/170/expected.json @@ -91,7 +91,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 14, "end": 15, "loc": { @@ -123,7 +123,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 14, @@ -142,7 +141,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 17, "end": 18, "loc": { @@ -174,7 +173,6 @@ }, "name": "b" }, - "kind": "init", "value": { "type": "Identifier", "start": 17, diff --git a/test/fixtures/harmony/uncategorised/173/expected.json b/test/fixtures/harmony/uncategorised/173/expected.json index 870de96929..35b8ef2474 100644 --- a/test/fixtures/harmony/uncategorised/173/expected.json +++ b/test/fixtures/harmony/uncategorised/173/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 3, "end": 16, "loc": { @@ -90,92 +90,77 @@ }, "name": "x" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 4, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "ArrayPattern", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "b" + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 14, "end": 16, "loc": { "start": { "line": 1, - "column": 4 + "column": 14 }, "end": { "line": 1, "column": 16 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "ArrayPattern", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "elements": [ - { - "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "name": "a" - }, - { - "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "b" - } - ] - } - ], - "body": { - "type": "BlockStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ], diff --git a/test/fixtures/harmony/uncategorised/178/expected.json b/test/fixtures/harmony/uncategorised/178/expected.json index 806994cb9b..15f1e7078a 100644 --- a/test/fixtures/harmony/uncategorised/178/expected.json +++ b/test/fixtures/harmony/uncategorised/178/expected.json @@ -76,7 +76,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 4, "loc": { @@ -108,7 +108,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 3, @@ -143,11 +142,12 @@ "column": 13 } }, - "body": [] + "body": [], + "directives": [] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/179/expected.json b/test/fixtures/harmony/uncategorised/179/expected.json index 4d7597a5b0..ce3a65a9ee 100644 --- a/test/fixtures/harmony/uncategorised/179/expected.json +++ b/test/fixtures/harmony/uncategorised/179/expected.json @@ -76,7 +76,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 4, "loc": { @@ -108,7 +108,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 3, @@ -174,11 +173,12 @@ "column": 19 } }, - "body": [] + "body": [], + "directives": [] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/182/expected.json b/test/fixtures/harmony/uncategorised/182/expected.json index d18c636d50..35cdf77789 100644 --- a/test/fixtures/harmony/uncategorised/182/expected.json +++ b/test/fixtures/harmony/uncategorised/182/expected.json @@ -76,7 +76,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 12, "loc": { @@ -156,8 +156,7 @@ "name": "b" } ] - }, - "kind": "init" + } } ] }, @@ -207,11 +206,12 @@ "column": 27 } }, - "body": [] + "body": [], + "directives": [] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/183/expected.json b/test/fixtures/harmony/uncategorised/183/expected.json index 52a957065f..79bc67b569 100644 --- a/test/fixtures/harmony/uncategorised/183/expected.json +++ b/test/fixtures/harmony/uncategorised/183/expected.json @@ -76,7 +76,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 7, "loc": { @@ -123,11 +123,10 @@ } }, "name": "b" - }, - "kind": "init" + } }, { - "type": "Property", + "type": "ObjectProperty", "start": 9, "end": 10, "loc": { @@ -159,7 +158,6 @@ }, "name": "c" }, - "kind": "init", "value": { "type": "Identifier", "start": 9, @@ -274,11 +272,12 @@ "column": 33 } }, - "body": [] + "body": [], + "directives": [] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/186/expected.json b/test/fixtures/harmony/uncategorised/186/expected.json index 525404a0e1..16d0a3f561 100644 --- a/test/fixtures/harmony/uncategorised/186/expected.json +++ b/test/fixtures/harmony/uncategorised/186/expected.json @@ -88,7 +88,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 3, "end": 4, "loc": { @@ -120,7 +120,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 3, @@ -139,7 +138,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 7, "loc": { @@ -171,7 +170,6 @@ }, "name": "b" }, - "kind": "init", "value": { "type": "Identifier", "start": 6, @@ -242,7 +240,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/190/expected.json b/test/fixtures/harmony/uncategorised/190/expected.json index bb2b744d13..dc0dd1b374 100644 --- a/test/fixtures/harmony/uncategorised/190/expected.json +++ b/test/fixtures/harmony/uncategorised/190/expected.json @@ -88,7 +88,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 7, "end": 8, "loc": { @@ -120,7 +120,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 7, @@ -139,7 +138,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 10, "end": 11, "loc": { @@ -171,7 +170,6 @@ }, "name": "b" }, - "kind": "init", "value": { "type": "Identifier", "start": 10, @@ -244,7 +242,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/26/expected.json b/test/fixtures/harmony/uncategorised/26/expected.json index a5de31017e..c14ff21a76 100644 --- a/test/fixtures/harmony/uncategorised/26/expected.json +++ b/test/fixtures/harmony/uncategorised/26/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 9, "end": 19, "loc": { @@ -121,7 +121,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 13, "end": 18, "loc": { @@ -172,12 +172,10 @@ "raw": "10" }, "value": 10 - }, - "kind": "init" + } } ] - }, - "kind": "init" + } } ] }, diff --git a/test/fixtures/harmony/uncategorised/303/expected.json b/test/fixtures/harmony/uncategorised/303/expected.json index c58193f339..64493bca6c 100644 --- a/test/fixtures/harmony/uncategorised/303/expected.json +++ b/test/fixtures/harmony/uncategorised/303/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 8, "loc": { @@ -105,7 +105,6 @@ }, "name": "get" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, @@ -145,6 +144,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/304/expected.json b/test/fixtures/harmony/uncategorised/304/expected.json index 8fb4b5b979..b66e1b6640 100644 --- a/test/fixtures/harmony/uncategorised/304/expected.json +++ b/test/fixtures/harmony/uncategorised/304/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 38, "loc": { @@ -151,8 +151,7 @@ }, "name": "defaultValue" } - }, - "kind": "init" + } } ] }, @@ -176,7 +175,7 @@ ], "kind": "var" } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/305/expected.json b/test/fixtures/harmony/uncategorised/305/expected.json index a47eedc258..07fa4a6986 100644 --- a/test/fixtures/harmony/uncategorised/305/expected.json +++ b/test/fixtures/harmony/uncategorised/305/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 28, "loc": { @@ -105,7 +105,6 @@ }, "name": "propName" }, - "kind": "init", "value": { "type": "AssignmentPattern", "start": 5, @@ -176,7 +175,7 @@ ], "kind": "var" } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/307/expected.json b/test/fixtures/harmony/uncategorised/307/expected.json index fa5a1fed3e..66529d6cc5 100644 --- a/test/fixtures/harmony/uncategorised/307/expected.json +++ b/test/fixtures/harmony/uncategorised/307/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 7, "loc": { @@ -105,7 +105,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "AssignmentPattern", "start": 2, diff --git a/test/fixtures/harmony/uncategorised/308/expected.json b/test/fixtures/harmony/uncategorised/308/expected.json index f13152264e..0b996626b8 100644 --- a/test/fixtures/harmony/uncategorised/308/expected.json +++ b/test/fixtures/harmony/uncategorised/308/expected.json @@ -76,7 +76,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 2, "end": 7, "loc": { @@ -108,7 +108,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "AssignmentPattern", "start": 2, diff --git a/test/fixtures/harmony/uncategorised/309/expected.json b/test/fixtures/harmony/uncategorised/309/expected.json index 21ff2e2c8b..a5c0d5db68 100644 --- a/test/fixtures/harmony/uncategorised/309/expected.json +++ b/test/fixtures/harmony/uncategorised/309/expected.json @@ -104,7 +104,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 15, "loc": { @@ -152,7 +152,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 9, "end": 14, "loc": { @@ -184,7 +184,6 @@ }, "name": "c" }, - "kind": "init", "value": { "type": "AssignmentPattern", "start": 9, @@ -238,8 +237,7 @@ } } ] - }, - "kind": "init" + } } ] } diff --git a/test/fixtures/harmony/uncategorised/310/expected.json b/test/fixtures/harmony/uncategorised/310/expected.json index efd6b8cb0f..d58ddf8b31 100644 --- a/test/fixtures/harmony/uncategorised/310/expected.json +++ b/test/fixtures/harmony/uncategorised/310/expected.json @@ -58,7 +58,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 11, "loc": { @@ -90,7 +90,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "AssignmentPattern", "start": 6, diff --git a/test/fixtures/harmony/uncategorised/313/expected.json b/test/fixtures/harmony/uncategorised/313/expected.json index d56fc1ce39..9a9139b799 100644 --- a/test/fixtures/harmony/uncategorised/313/expected.json +++ b/test/fixtures/harmony/uncategorised/313/expected.json @@ -56,7 +56,8 @@ "column": 6 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -88,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 15, "end": 22, "loc": { @@ -120,7 +121,6 @@ }, "name": "message" }, - "kind": "init", "value": { "type": "Identifier", "start": 15, @@ -154,13 +154,14 @@ "column": 27 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/314/expected.json b/test/fixtures/harmony/uncategorised/314/expected.json index 251b838ffe..859c4a7b48 100644 --- a/test/fixtures/harmony/uncategorised/314/expected.json +++ b/test/fixtures/harmony/uncategorised/314/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 21, "loc": { @@ -107,46 +107,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 16, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, "end": 21, "loc": { "start": { "line": 1, - "column": 16 + "column": 19 }, "end": { "line": 1, "column": 21 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/316/expected.json b/test/fixtures/harmony/uncategorised/316/expected.json index d0a93d30d0..ec67c88b06 100644 --- a/test/fixtures/harmony/uncategorised/316/expected.json +++ b/test/fixtures/harmony/uncategorised/316/expected.json @@ -75,7 +75,7 @@ }, "body": [ { - "type": "MethodDefinition", + "type": "ClassMethod", "start": 10, "end": 22, "loc": { @@ -107,46 +107,32 @@ }, "static": false, "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 17, + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, "end": 22, "loc": { "start": { "line": 1, - "column": 17 + "column": 20 }, "end": { "line": 1, "column": 22 } }, - "id": null, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/321/expected.json b/test/fixtures/harmony/uncategorised/321/expected.json index 6b9c75753f..304fea8a0d 100644 --- a/test/fixtures/harmony/uncategorised/321/expected.json +++ b/test/fixtures/harmony/uncategorised/321/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 6, "loc": { @@ -105,7 +105,6 @@ }, "name": "x" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, @@ -145,6 +144,7 @@ ], "kind": "let" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/33/expected.json b/test/fixtures/harmony/uncategorised/33/expected.json index fbd87bd0c4..8025e7a342 100644 --- a/test/fixtures/harmony/uncategorised/33/expected.json +++ b/test/fixtures/harmony/uncategorised/33/expected.json @@ -93,7 +93,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 8, "end": 20, "loc": { @@ -144,8 +144,7 @@ "raw": "42" }, "value": 42 - }, - "kind": "init" + } } ], "extra": { diff --git a/test/fixtures/harmony/uncategorised/347/options.json b/test/fixtures/harmony/uncategorised/347/options.json index 1cddead191..739bda889b 100644 --- a/test/fixtures/harmony/uncategorised/347/options.json +++ b/test/fixtures/harmony/uncategorised/347/options.json @@ -1,3 +1,3 @@ { - "throws": "setter should have exactly one param (1:18)" -} \ No newline at end of file + "throws": "setter should have exactly one param (1:10)" +} diff --git a/test/fixtures/harmony/uncategorised/52/expected.json b/test/fixtures/harmony/uncategorised/52/expected.json index bb2d92ab6e..880dce74c2 100644 --- a/test/fixtures/harmony/uncategorised/52/expected.json +++ b/test/fixtures/harmony/uncategorised/52/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 18, "loc": { @@ -121,48 +121,34 @@ }, "name": "method" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 12, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, "end": 18, "loc": { "start": { "line": 1, - "column": 12 + "column": 15 }, "end": { "line": 1, "column": 18 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/53/expected.json b/test/fixtures/harmony/uncategorised/53/expected.json index 75665ddf61..7d5dce4954 100644 --- a/test/fixtures/harmony/uncategorised/53/expected.json +++ b/test/fixtures/harmony/uncategorised/53/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 22, "loc": { @@ -121,65 +121,51 @@ }, "name": "method" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 12, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "test" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, "end": 22, "loc": { "start": { "line": 1, - "column": 12 + "column": 19 }, "end": { "line": 1, "column": 22 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "test" - } - ], - "body": { - "type": "BlockStatement", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/54/expected.json b/test/fixtures/harmony/uncategorised/54/expected.json index e964b38846..1030bf0af2 100644 --- a/test/fixtures/harmony/uncategorised/54/expected.json +++ b/test/fixtures/harmony/uncategorised/54/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 20, "loc": { @@ -125,42 +125,27 @@ }, "value": "method" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 14, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, "end": 20, "loc": { "start": { "line": 1, - "column": 14 + "column": 17 }, "end": { "line": 1, "column": 20 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [], - "directives": [] - } + "body": [], + "directives": [] } } ] diff --git a/test/fixtures/harmony/uncategorised/55/expected.json b/test/fixtures/harmony/uncategorised/55/expected.json index 442afea2b9..0b0d3f1c10 100644 --- a/test/fixtures/harmony/uncategorised/55/expected.json +++ b/test/fixtures/harmony/uncategorised/55/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 15, "loc": { @@ -121,48 +121,34 @@ }, "name": "get" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 9, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 15, "loc": { "start": { "line": 1, - "column": 9 + "column": 12 }, "end": { "line": 1, "column": 15 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/56/expected.json b/test/fixtures/harmony/uncategorised/56/expected.json index 3545909350..b118b76443 100644 --- a/test/fixtures/harmony/uncategorised/56/expected.json +++ b/test/fixtures/harmony/uncategorised/56/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectMethod", "start": 6, "end": 15, "loc": { @@ -121,48 +121,34 @@ }, "name": "set" }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 9, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, "end": 15, "loc": { "start": { "line": 1, - "column": 9 + "column": 12 }, "end": { "line": 1, "column": 15 } }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "body": [] - } + "body": [], + "directives": [] } } ] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/61/expected.json b/test/fixtures/harmony/uncategorised/61/expected.json index 592ee20049..660265dd75 100644 --- a/test/fixtures/harmony/uncategorised/61/expected.json +++ b/test/fixtures/harmony/uncategorised/61/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 6, "end": 7, "loc": { @@ -121,7 +121,6 @@ }, "name": "y" }, - "kind": "init", "value": { "type": "Identifier", "start": 6, @@ -140,7 +139,7 @@ } }, { - "type": "Property", + "type": "ObjectProperty", "start": 9, "end": 10, "loc": { @@ -172,7 +171,6 @@ }, "name": "z" }, - "kind": "init", "value": { "type": "Identifier", "start": 9, @@ -194,7 +192,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/63/expected.json b/test/fixtures/harmony/uncategorised/63/expected.json index f8d73fc297..f17d4e7f50 100644 --- a/test/fixtures/harmony/uncategorised/63/expected.json +++ b/test/fixtures/harmony/uncategorised/63/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 7, "end": 8, "loc": { @@ -105,7 +105,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 7, @@ -145,7 +144,7 @@ ], "kind": "const" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/65/expected.json b/test/fixtures/harmony/uncategorised/65/expected.json index beb62b1d35..d449479dc0 100644 --- a/test/fixtures/harmony/uncategorised/65/expected.json +++ b/test/fixtures/harmony/uncategorised/65/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 6, "loc": { @@ -105,7 +105,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, @@ -145,7 +144,7 @@ ], "kind": "let" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/67/expected.json b/test/fixtures/harmony/uncategorised/67/expected.json index 870ab05ccc..5847b666e3 100644 --- a/test/fixtures/harmony/uncategorised/67/expected.json +++ b/test/fixtures/harmony/uncategorised/67/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 6, "loc": { @@ -105,7 +105,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 5, @@ -145,7 +144,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/69/expected.json b/test/fixtures/harmony/uncategorised/69/expected.json index bad27b27c6..f2577d66d0 100644 --- a/test/fixtures/harmony/uncategorised/69/expected.json +++ b/test/fixtures/harmony/uncategorised/69/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 7, "end": 10, "loc": { @@ -120,8 +120,7 @@ } }, "name": "b" - }, - "kind": "init" + } } ] }, @@ -145,7 +144,7 @@ ], "kind": "const" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/70/expected.json b/test/fixtures/harmony/uncategorised/70/expected.json index 37cca27feb..a9efc0fea7 100644 --- a/test/fixtures/harmony/uncategorised/70/expected.json +++ b/test/fixtures/harmony/uncategorised/70/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 8, "loc": { @@ -120,8 +120,7 @@ } }, "name": "b" - }, - "kind": "init" + } } ] }, @@ -145,7 +144,7 @@ ], "kind": "let" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/71/expected.json b/test/fixtures/harmony/uncategorised/71/expected.json index 6a0f96a0d8..0615d247ab 100644 --- a/test/fixtures/harmony/uncategorised/71/expected.json +++ b/test/fixtures/harmony/uncategorised/71/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 5, "end": 8, "loc": { @@ -120,8 +120,7 @@ } }, "name": "b" - }, - "kind": "init" + } } ] }, @@ -145,7 +144,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/10/expected.json b/test/fixtures/jsx/basic/10/expected.json index 7dbf341df0..74329dfd09 100644 --- a/test/fixtures/jsx/basic/10/expected.json +++ b/test/fixtures/jsx/basic/10/expected.json @@ -156,20 +156,8 @@ }, "expression": { "type": "JSXEmptyExpression", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "leadingComments": null, - "innerComments": [ + "loc": {}, + "leadingComments": [ { "type": "CommentBlock", "value": " this is a comment ", @@ -187,7 +175,26 @@ } } ] - } + }, + "leadingComments": null, + "innerComments": [ + { + "type": "CommentBlock", + "value": " this is a comment ", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + } + } + ] } ] } diff --git a/test/fixtures/jsx/basic/empty-expression-container/expected.json b/test/fixtures/jsx/basic/empty-expression-container/expected.json index 3f1a13918e..157403e9bf 100644 --- a/test/fixtures/jsx/basic/empty-expression-container/expected.json +++ b/test/fixtures/jsx/basic/empty-expression-container/expected.json @@ -137,24 +137,13 @@ }, "expression": { "type": "JSXEmptyExpression", - "start": 4, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 4 - } - } + "loc": {} } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/3/expected.json b/test/fixtures/jsx/regression/3/expected.json index e12dd8c418..d4081dc212 100644 --- a/test/fixtures/jsx/regression/3/expected.json +++ b/test/fixtures/jsx/regression/3/expected.json @@ -151,7 +151,7 @@ }, "properties": [ { - "type": "Property", + "type": "ObjectProperty", "start": 8, "end": 9, "loc": { @@ -183,7 +183,6 @@ }, "name": "a" }, - "kind": "init", "value": { "type": "Identifier", "start": 8, @@ -207,7 +206,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/index.js b/test/index.js index 6dc0156769..0954e19df9 100644 --- a/test/index.js +++ b/test/index.js @@ -59,7 +59,7 @@ function runTest(test) { } else { var mis = misMatch(JSON.parse(test.expect.code), ast); if (mis) { - // save(test, ast); + //save(test, ast); throw new Error(mis); } }