[Pkg-javascript-commits] [node-esprima] 01/04: New upstream version 3.1.3+ds
Julien Puydt
julien.puydt at laposte.net
Wed Jan 11 08:59:38 UTC 2017
This is an automated email from the git hooks/post-receive script.
jpuydt-guest pushed a commit to branch master
in repository node-esprima.
commit 770ab4331ec561dbf5a7f02fa3cce58a805f69a9
Author: Julien Puydt <julien.puydt at laposte.net>
Date: Wed Jan 11 09:55:50 2017 +0100
New upstream version 3.1.3+ds
---
ChangeLog | 5 +
package.json | 2 +-
src/esprima.ts | 2 +-
src/messages.ts | 1 -
src/nodes.ts | 4 +-
src/parser.ts | 63 ++-
.../complex-rest-in-arrow-not-allowed.failure.json | 1 -
...id-duplicated-names-rest-parameter.failure.json | 1 +
... => invalid-duplicated-names-rest-parameter.js} | 0
.../array-pattern/rest-element-array-pattern.js | 1 +
.../rest-element-array-pattern.tree.json | 312 ++++++++++++
.../array-pattern/rest-element-object-pattern.js | 1 +
.../rest-element-object-pattern.tree.json | 351 +++++++++++++
.../rest-parameter/arrow-rest-parameter-array.js | 1 +
.../arrow-rest-parameter-array.tree.json | 331 ++++++++++++
.../rest-parameter/arrow-rest-parameter-object.js | 1 +
.../arrow-rest-parameter-object.tree.json | 370 ++++++++++++++
.../ES6/rest-parameter/rest-parameter-array.js | 1 +
.../rest-parameter/rest-parameter-array.tree.json | 313 ++++++++++++
.../ES6/rest-parameter/rest-parameter-object.js | 1 +
.../rest-parameter/rest-parameter-object.tree.json | 352 +++++++++++++
test/fixtures/ES6/yield/ternary-yield.js | 1 +
test/fixtures/ES6/yield/ternary-yield.tree.json | 384 ++++++++++++++
test/fixtures/ES6/yield/yield-arg-array.js | 1 +
test/fixtures/ES6/yield/yield-arg-array.tree.json | 349 +++++++++++++
test/fixtures/ES6/yield/yield-arg-bitnot.js | 1 +
test/fixtures/ES6/yield/yield-arg-bitnot.tree.json | 331 ++++++++++++
test/fixtures/ES6/yield/yield-arg-class.js | 1 +
test/fixtures/ES6/yield/yield-arg-class.tree.json | 384 ++++++++++++++
test/fixtures/ES6/yield/yield-arg-delete.js | 1 +
test/fixtures/ES6/yield/yield-arg-delete.tree.json | 331 ++++++++++++
test/fixtures/ES6/yield/yield-arg-function.js | 1 +
.../ES6/yield/yield-arg-function.tree.json | 387 ++++++++++++++
test/fixtures/ES6/yield/yield-arg-group.js | 1 +
test/fixtures/ES6/yield/yield-arg-group.tree.json | 330 ++++++++++++
test/fixtures/ES6/yield/yield-arg-let.js | 1 +
test/fixtures/ES6/yield/yield-arg-let.tree.json | 294 +++++++++++
test/fixtures/ES6/yield/yield-arg-minus.js | 1 +
test/fixtures/ES6/yield/yield-arg-minus.tree.json | 331 ++++++++++++
test/fixtures/ES6/yield/yield-arg-minusminus.js | 1 +
.../ES6/yield/yield-arg-minusminus.tree.json | 331 ++++++++++++
test/fixtures/ES6/yield/yield-arg-new.js | 1 +
test/fixtures/ES6/yield/yield-arg-new.tree.json | 366 +++++++++++++
test/fixtures/ES6/yield/yield-arg-not.js | 1 +
test/fixtures/ES6/yield/yield-arg-not.tree.json | 331 ++++++++++++
test/fixtures/ES6/yield/yield-arg-object.js | 1 +
test/fixtures/ES6/yield/yield-arg-object.tree.json | 388 ++++++++++++++
test/fixtures/ES6/yield/yield-arg-plus.js | 1 +
test/fixtures/ES6/yield/yield-arg-plus.tree.json | 331 ++++++++++++
test/fixtures/ES6/yield/yield-arg-plusplus.js | 1 +
.../ES6/yield/yield-arg-plusplus.tree.json | 331 ++++++++++++
test/fixtures/ES6/yield/yield-arg-regexp1.js | 1 +
.../fixtures/ES6/yield/yield-arg-regexp1.tree.json | 303 +++++++++++
test/fixtures/ES6/yield/yield-arg-regexp2.js | 1 +
.../fixtures/ES6/yield/yield-arg-regexp2.tree.json | 303 +++++++++++
test/fixtures/ES6/yield/yield-arg-super.js | 1 +
test/fixtures/ES6/yield/yield-arg-super.tree.json | 567 +++++++++++++++++++++
test/fixtures/ES6/yield/yield-arg-this.js | 1 +
test/fixtures/ES6/yield/yield-arg-this.tree.json | 293 +++++++++++
test/fixtures/ES6/yield/yield-arg-typeof.js | 1 +
test/fixtures/ES6/yield/yield-arg-typeof.tree.json | 331 ++++++++++++
test/fixtures/ES6/yield/yield-arg-void.js | 1 +
test/fixtures/ES6/yield/yield-arg-void.tree.json | 331 ++++++++++++
.../invalid-syntax/migrated_0259.failure.json | 6 -
test/fixtures/invalid-syntax/migrated_0259.js | 1 -
65 files changed, 9430 insertions(+), 39 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bdfdd07..23bcdc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-22: Version 3.1.3
+
+ * Support binding patterns as rest element (issue 1681)
+ * Account for different possible arguments of a yield expression (issue 1469)
+
2016-11-24: Version 3.1.2
* Ensure that import specifier is more restrictive (issue 1615)
diff --git a/package.json b/package.json
index ff1fa03..4ce474d 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"esparse": "./bin/esparse.js",
"esvalidate": "./bin/esvalidate.js"
},
- "version": "3.1.2",
+ "version": "3.1.3",
"files": [
"bin",
"dist/esprima.js"
diff --git a/src/esprima.ts b/src/esprima.ts
index ff4538d..3410f0f 100644
--- a/src/esprima.ts
+++ b/src/esprima.ts
@@ -104,4 +104,4 @@ export function tokenize(code: string, options, delegate) {
export { Syntax } from './syntax';
// Sync with *.json manifests.
-export const version = '3.1.2';
+export const version = '3.1.3';
diff --git a/src/messages.ts b/src/messages.ts
index 32f2cad..cebe12b 100644
--- a/src/messages.ts
+++ b/src/messages.ts
@@ -36,7 +36,6 @@ export const Messages = {
TemplateOctalLiteral: 'Octal literals are not allowed in template strings.',
ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
DefaultRestParameter: 'Unexpected token =',
- ObjectPatternAsRestParameter: 'Unexpected token {',
DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
ConstructorSpecialMethod: 'Class constructor may not be an accessor',
DuplicateConstructor: 'A class may only have one constructor',
diff --git a/src/nodes.ts b/src/nodes.ts
index bedaf08..07318b5 100644
--- a/src/nodes.ts
+++ b/src/nodes.ts
@@ -554,8 +554,8 @@ export class RegexLiteral {
export class RestElement {
type: string;
- argument: Identifier;
- constructor(argument: Identifier) {
+ argument: BindingIdentifier | BindingPattern;
+ constructor(argument: BindingIdentifier | BindingPattern) {
this.type = Syntax.RestElement;
this.argument = argument;
}
diff --git a/src/parser.ts b/src/parser.ts
index 3ccd575..b81cb8d 100644
--- a/src/parser.ts
+++ b/src/parser.ts
@@ -1755,9 +1755,10 @@ export class Parser {
parseBindingRestElement(params, kind: string): Node.RestElement {
const node = this.createNode();
+
this.expect('...');
- params.push(this.lookahead);
- const arg = this.parseVariableIdentifier(kind);
+ const arg = this.parsePattern(params, kind);
+
return this.finalize(node, new Node.RestElement(arg));
}
@@ -2601,13 +2602,8 @@ export class Parser {
parseRestElement(params): Node.RestElement {
const node = this.createNode();
- this.nextToken();
- if (this.match('{')) {
- this.throwError(Messages.ObjectPatternAsRestParameter);
- }
- params.push(this.lookahead);
-
- const param = this.parseVariableIdentifier();
+ this.expect('...');
+ const arg = this.parsePattern(params);
if (this.match('=')) {
this.throwError(Messages.DefaultRestParameter);
}
@@ -2615,22 +2611,12 @@ export class Parser {
this.throwError(Messages.ParameterAfterRestParameter);
}
- return this.finalize(node, new Node.RestElement(param));
+ return this.finalize(node, new Node.RestElement(arg));
}
parseFormalParameter(options) {
- let param;
- let params = [];
-
- const token = this.lookahead;
- if (token.value === '...') {
- param = this.parseRestElement(params);
- this.validateParam(options, param.argument, param.argument.name);
- options.params.push(param);
- return false;
- }
-
- param = this.parsePatternWithDefault(params);
+ let params: any[] = [];
+ const param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params);
for (let i = 0; i < params.length; i++) {
this.validateParam(options, params[i], params[i].value);
}
@@ -2910,6 +2896,33 @@ export class Parser {
// ECMA-262 14.4 Generator Function Definitions
+ isStartOfExpression(): boolean {
+ let start = true;
+
+ const value = this.lookahead.value;
+ switch (this.lookahead.type) {
+ case Token.Punctuator:
+ start = (value === '[') || (value === '(') || (value === '{') ||
+ (value === '+') || (value === '-') ||
+ (value === '!') || (value === '~') ||
+ (value === '++') || (value === '--') ||
+ (value === '/') || (value === '/='); // regular expression literal
+ break;
+
+ case Token.Keyword:
+ start = (value === 'class') || (value === 'delete') ||
+ (value === 'function') || (value === 'let') || (value === 'new') ||
+ (value === 'super') || (value === 'this') || (value === 'typeof') ||
+ (value === 'void') || (value === 'yield');
+ break;
+
+ default:
+ break;
+ }
+
+ return start;
+ }
+
parseYieldExpression(): Node.YieldExpression {
const node = this.createNode();
this.expectKeyword('yield');
@@ -2923,10 +2936,8 @@ export class Parser {
if (delegate) {
this.nextToken();
argument = this.parseAssignmentExpression();
- } else {
- if (!this.match(';') && !this.match('}') && !this.match(')') && this.lookahead.type !== Token.EOF) {
- argument = this.parseAssignmentExpression();
- }
+ } else if (this.isStartOfExpression()) {
+ argument = this.parseAssignmentExpression();
}
this.context.allowYield = previousAllowYield;
}
diff --git a/test/fixtures/ES6/arrow-function/complex-rest-in-arrow-not-allowed.failure.json b/test/fixtures/ES6/arrow-function/complex-rest-in-arrow-not-allowed.failure.json
deleted file mode 100644
index 300fb60..0000000
--- a/test/fixtures/ES6/arrow-function/complex-rest-in-arrow-not-allowed.failure.json
+++ /dev/null
@@ -1 +0,0 @@
-{"index":6,"lineNumber":1,"column":7,"message":"Error: Line 1: Unexpected token [","description":"Unexpected token ["}
\ No newline at end of file
diff --git a/test/fixtures/ES6/arrow-function/invalid-duplicated-names-rest-parameter.failure.json b/test/fixtures/ES6/arrow-function/invalid-duplicated-names-rest-parameter.failure.json
new file mode 100644
index 0000000..3ecda33
--- /dev/null
+++ b/test/fixtures/ES6/arrow-function/invalid-duplicated-names-rest-parameter.failure.json
@@ -0,0 +1 @@
+{"index":10,"lineNumber":1,"column":11,"message":"Error: Line 1: Strict mode function may not have duplicate parameter names","description":"Strict mode function may not have duplicate parameter names"}
\ No newline at end of file
diff --git a/test/fixtures/ES6/arrow-function/complex-rest-in-arrow-not-allowed.js b/test/fixtures/ES6/arrow-function/invalid-duplicated-names-rest-parameter.js
similarity index 100%
rename from test/fixtures/ES6/arrow-function/complex-rest-in-arrow-not-allowed.js
rename to test/fixtures/ES6/arrow-function/invalid-duplicated-names-rest-parameter.js
diff --git a/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-array-pattern.js b/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-array-pattern.js
new file mode 100644
index 0000000..ffd84fd
--- /dev/null
+++ b/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-array-pattern.js
@@ -0,0 +1 @@
+let [...[x]] = y
diff --git a/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-array-pattern.tree.json b/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-array-pattern.tree.json
new file mode 100644
index 0000000..31d1dc3
--- /dev/null
+++ b/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-array-pattern.tree.json
@@ -0,0 +1,312 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "ArrayPattern",
+ "elements": [
+ {
+ "type": "RestElement",
+ "argument": {
+ "type": "ArrayPattern",
+ "elements": [
+ {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ }
+ ],
+ "range": [
+ 8,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "range": [
+ 5,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ }
+ ],
+ "range": [
+ 4,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ "init": {
+ "type": "Identifier",
+ "name": "y",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "range": [
+ 4,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ],
+ "kind": "let",
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "let",
+ "range": [
+ 0,
+ 3
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "range": [
+ 4,
+ 5
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "...",
+ "range": [
+ 5,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "y",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-object-pattern.js b/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-object-pattern.js
new file mode 100644
index 0000000..daaea8e
--- /dev/null
+++ b/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-object-pattern.js
@@ -0,0 +1 @@
+var [...{x}] = y
diff --git a/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-object-pattern.tree.json b/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-object-pattern.tree.json
new file mode 100644
index 0000000..24faa9f
--- /dev/null
+++ b/test/fixtures/ES6/binding-pattern/array-pattern/rest-element-object-pattern.tree.json
@@ -0,0 +1,351 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "ArrayPattern",
+ "elements": [
+ {
+ "type": "RestElement",
+ "argument": {
+ "type": "ObjectPattern",
+ "properties": [
+ {
+ "type": "Property",
+ "key": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ "computed": false,
+ "value": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ "kind": "init",
+ "method": false,
+ "shorthand": true,
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ }
+ ],
+ "range": [
+ 8,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "range": [
+ 5,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ }
+ ],
+ "range": [
+ 4,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ "init": {
+ "type": "Identifier",
+ "name": "y",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "range": [
+ 4,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ],
+ "kind": "var",
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "var",
+ "range": [
+ 0,
+ 3
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "range": [
+ 4,
+ 5
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "...",
+ "range": [
+ 5,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "y",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-array.js b/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-array.js
new file mode 100644
index 0000000..3deff8c
--- /dev/null
+++ b/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-array.js
@@ -0,0 +1 @@
+(a, ...[b]) => c
diff --git a/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-array.tree.json b/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-array.tree.json
new file mode 100644
index 0000000..7bea770
--- /dev/null
+++ b/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-array.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "id": null,
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "a",
+ "range": [
+ 1,
+ 2
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ }
+ },
+ {
+ "type": "RestElement",
+ "argument": {
+ "type": "ArrayPattern",
+ "elements": [
+ {
+ "type": "Identifier",
+ "name": "b",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ }
+ ],
+ "range": [
+ 7,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 4,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "name": "c",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "generator": false,
+ "expression": true,
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 0,
+ 1
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "range": [
+ 1,
+ 2
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "range": [
+ 2,
+ 3
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "...",
+ "range": [
+ 4,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "=>",
+ "range": [
+ 12,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "c",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-object.js b/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-object.js
new file mode 100644
index 0000000..5f444a4
--- /dev/null
+++ b/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-object.js
@@ -0,0 +1 @@
+(a, ...{b}) => c
diff --git a/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-object.tree.json b/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-object.tree.json
new file mode 100644
index 0000000..2c2fa20
--- /dev/null
+++ b/test/fixtures/ES6/rest-parameter/arrow-rest-parameter-object.tree.json
@@ -0,0 +1,370 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "id": null,
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "a",
+ "range": [
+ 1,
+ 2
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ }
+ },
+ {
+ "type": "RestElement",
+ "argument": {
+ "type": "ObjectPattern",
+ "properties": [
+ {
+ "type": "Property",
+ "key": {
+ "type": "Identifier",
+ "name": "b",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ },
+ "computed": false,
+ "value": {
+ "type": "Identifier",
+ "name": "b",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ },
+ "kind": "init",
+ "method": false,
+ "shorthand": true,
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ }
+ ],
+ "range": [
+ 7,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 4,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "Identifier",
+ "name": "c",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "generator": false,
+ "expression": true,
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 0,
+ 1
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "range": [
+ 1,
+ 2
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 2
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "range": [
+ 2,
+ 3
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 2
+ },
+ "end": {
+ "line": 1,
+ "column": 3
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "...",
+ "range": [
+ 4,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 4
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "=>",
+ "range": [
+ 12,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "c",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/rest-parameter/rest-parameter-array.js b/test/fixtures/ES6/rest-parameter/rest-parameter-array.js
new file mode 100644
index 0000000..be49b91
--- /dev/null
+++ b/test/fixtures/ES6/rest-parameter/rest-parameter-array.js
@@ -0,0 +1 @@
+function f(...[a]) {}
diff --git a/test/fixtures/ES6/rest-parameter/rest-parameter-array.tree.json b/test/fixtures/ES6/rest-parameter/rest-parameter-array.tree.json
new file mode 100644
index 0000000..d4d62d3
--- /dev/null
+++ b/test/fixtures/ES6/rest-parameter/rest-parameter-array.tree.json
@@ -0,0 +1,313 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "f",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ "params": [
+ {
+ "type": "RestElement",
+ "argument": {
+ "type": "ArrayPattern",
+ "elements": [
+ {
+ "type": "Identifier",
+ "name": "a",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ }
+ },
+ "range": [
+ 11,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "body": [],
+ "range": [
+ 19,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 0,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "f",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "...",
+ "range": [
+ 11,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "range": [
+ 16,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/rest-parameter/rest-parameter-object.js b/test/fixtures/ES6/rest-parameter/rest-parameter-object.js
new file mode 100644
index 0000000..96eaa62
--- /dev/null
+++ b/test/fixtures/ES6/rest-parameter/rest-parameter-object.js
@@ -0,0 +1 @@
+function f(...{a}) {}
diff --git a/test/fixtures/ES6/rest-parameter/rest-parameter-object.tree.json b/test/fixtures/ES6/rest-parameter/rest-parameter-object.tree.json
new file mode 100644
index 0000000..d2eaec5
--- /dev/null
+++ b/test/fixtures/ES6/rest-parameter/rest-parameter-object.tree.json
@@ -0,0 +1,352 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "f",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ "params": [
+ {
+ "type": "RestElement",
+ "argument": {
+ "type": "ObjectPattern",
+ "properties": [
+ {
+ "type": "Property",
+ "key": {
+ "type": "Identifier",
+ "name": "a",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "computed": false,
+ "value": {
+ "type": "Identifier",
+ "name": "a",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "kind": "init",
+ "method": false,
+ "shorthand": true,
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ }
+ },
+ "range": [
+ 11,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ }
+ }
+ ],
+ "body": {
+ "type": "BlockStatement",
+ "body": [],
+ "range": [
+ 19,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 0,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "f",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "...",
+ "range": [
+ 11,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 16,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 17
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 20
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 20
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/ternary-yield.js b/test/fixtures/ES6/yield/ternary-yield.js
new file mode 100644
index 0000000..3baa077
--- /dev/null
+++ b/test/fixtures/ES6/yield/ternary-yield.js
@@ -0,0 +1 @@
+function* g(){ x ? yield : y }
diff --git a/test/fixtures/ES6/yield/ternary-yield.tree.json b/test/fixtures/ES6/yield/ternary-yield.tree.json
new file mode 100644
index 0000000..9c57c9b
--- /dev/null
+++ b/test/fixtures/ES6/yield/ternary-yield.tree.json
@@ -0,0 +1,384 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "ConditionalExpression",
+ "test": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ "consequent": {
+ "type": "YieldExpression",
+ "argument": null,
+ "delegate": false,
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "alternate": {
+ "type": "Identifier",
+ "name": "y",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ "range": [
+ 15,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ "range": [
+ 15,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ }
+ ],
+ "range": [
+ 13,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "?",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ":",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "y",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-array.js b/test/fixtures/ES6/yield/yield-arg-array.js
new file mode 100644
index 0000000..ae96ce2
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-array.js
@@ -0,0 +1 @@
+function *g() { yield [x] }
diff --git a/test/fixtures/ES6/yield/yield-arg-array.tree.json b/test/fixtures/ES6/yield/yield-arg-array.tree.json
new file mode 100644
index 0000000..51795ab
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-array.tree.json
@@ -0,0 +1,349 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "ArrayExpression",
+ "elements": [
+ {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ }
+ ],
+ "range": [
+ 22,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 16,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-bitnot.js b/test/fixtures/ES6/yield/yield-arg-bitnot.js
new file mode 100644
index 0000000..8dc6777
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-bitnot.js
@@ -0,0 +1 @@
+function *g() { yield ~x }
diff --git a/test/fixtures/ES6/yield/yield-arg-bitnot.tree.json b/test/fixtures/ES6/yield/yield-arg-bitnot.tree.json
new file mode 100644
index 0000000..63984fb
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-bitnot.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "UnaryExpression",
+ "operator": "~",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 22,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "~",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-class.js b/test/fixtures/ES6/yield/yield-arg-class.js
new file mode 100644
index 0000000..3f620e1
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-class.js
@@ -0,0 +1 @@
+function *g() { yield class x {} }
diff --git a/test/fixtures/ES6/yield/yield-arg-class.tree.json b/test/fixtures/ES6/yield/yield-arg-class.tree.json
new file mode 100644
index 0000000..2c0ec47
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-class.tree.json
@@ -0,0 +1,384 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "ClassExpression",
+ "id": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "body": [],
+ "range": [
+ 30,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ "range": [
+ 22,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ "range": [
+ 16,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "class",
+ "range": [
+ 22,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 33,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-delete.js b/test/fixtures/ES6/yield/yield-arg-delete.js
new file mode 100644
index 0000000..108567c
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-delete.js
@@ -0,0 +1 @@
+function *g() { yield delete x }
diff --git a/test/fixtures/ES6/yield/yield-arg-delete.tree.json b/test/fixtures/ES6/yield/yield-arg-delete.tree.json
new file mode 100644
index 0000000..77051fe
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-delete.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "UnaryExpression",
+ "operator": "delete",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 22,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "range": [
+ 16,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "delete",
+ "range": [
+ 22,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-function.js b/test/fixtures/ES6/yield/yield-arg-function.js
new file mode 100644
index 0000000..eba2d39
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-function.js
@@ -0,0 +1 @@
+function *g() { yield function(){} }
diff --git a/test/fixtures/ES6/yield/yield-arg-function.tree.json b/test/fixtures/ES6/yield/yield-arg-function.tree.json
new file mode 100644
index 0000000..136261d
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-function.tree.json
@@ -0,0 +1,387 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "FunctionExpression",
+ "id": null,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [],
+ "range": [
+ 32,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ }
+ },
+ "generator": false,
+ "expression": false,
+ "range": [
+ 22,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ }
+ },
+ "range": [
+ 16,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 22,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 33,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-group.js b/test/fixtures/ES6/yield/yield-arg-group.js
new file mode 100644
index 0000000..5adaa5d
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-group.js
@@ -0,0 +1 @@
+function *g() { yield (x) }
diff --git a/test/fixtures/ES6/yield/yield-arg-group.tree.json b/test/fixtures/ES6/yield/yield-arg-group.tree.json
new file mode 100644
index 0000000..953d9a2
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-group.tree.json
@@ -0,0 +1,330 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 16,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-let.js b/test/fixtures/ES6/yield/yield-arg-let.js
new file mode 100644
index 0000000..885a39b
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-let.js
@@ -0,0 +1 @@
+function *g() { yield let }
diff --git a/test/fixtures/ES6/yield/yield-arg-let.tree.json b/test/fixtures/ES6/yield/yield-arg-let.tree.json
new file mode 100644
index 0000000..9e75854
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-let.tree.json
@@ -0,0 +1,294 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "Identifier",
+ "name": "let",
+ "range": [
+ 22,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 16,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "let",
+ "range": [
+ 22,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-minus.js b/test/fixtures/ES6/yield/yield-arg-minus.js
new file mode 100644
index 0000000..f4b7655
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-minus.js
@@ -0,0 +1 @@
+function *g() { yield -x }
diff --git a/test/fixtures/ES6/yield/yield-arg-minus.tree.json b/test/fixtures/ES6/yield/yield-arg-minus.tree.json
new file mode 100644
index 0000000..f54f2b5
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-minus.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "UnaryExpression",
+ "operator": "-",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 22,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "-",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-minusminus.js b/test/fixtures/ES6/yield/yield-arg-minusminus.js
new file mode 100644
index 0000000..a7555d5
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-minusminus.js
@@ -0,0 +1 @@
+function *g() { yield --x }
diff --git a/test/fixtures/ES6/yield/yield-arg-minusminus.tree.json b/test/fixtures/ES6/yield/yield-arg-minusminus.tree.json
new file mode 100644
index 0000000..48b49c1
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-minusminus.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "UpdateExpression",
+ "operator": "--",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 22,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 16,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "--",
+ "range": [
+ 22,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-new.js b/test/fixtures/ES6/yield/yield-arg-new.js
new file mode 100644
index 0000000..b3f07f5
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-new.js
@@ -0,0 +1 @@
+function *g() { yield new X() }
diff --git a/test/fixtures/ES6/yield/yield-arg-new.tree.json b/test/fixtures/ES6/yield/yield-arg-new.tree.json
new file mode 100644
index 0000000..1d3bf3b
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-new.tree.json
@@ -0,0 +1,366 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "NewExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "X",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ "arguments": [],
+ "range": [
+ 22,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ },
+ "range": [
+ 16,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "new",
+ "range": [
+ 22,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "X",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-not.js b/test/fixtures/ES6/yield/yield-arg-not.js
new file mode 100644
index 0000000..48cf466
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-not.js
@@ -0,0 +1 @@
+function *g() { yield !x }
diff --git a/test/fixtures/ES6/yield/yield-arg-not.tree.json b/test/fixtures/ES6/yield/yield-arg-not.tree.json
new file mode 100644
index 0000000..70471c3
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-not.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "UnaryExpression",
+ "operator": "!",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 22,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "!",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-object.js b/test/fixtures/ES6/yield/yield-arg-object.js
new file mode 100644
index 0000000..cfb5ad2
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-object.js
@@ -0,0 +1 @@
+function *g() { yield {x} }
diff --git a/test/fixtures/ES6/yield/yield-arg-object.tree.json b/test/fixtures/ES6/yield/yield-arg-object.tree.json
new file mode 100644
index 0000000..74e12d0
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-object.tree.json
@@ -0,0 +1,388 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "ObjectExpression",
+ "properties": [
+ {
+ "type": "Property",
+ "key": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "computed": false,
+ "value": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "kind": "init",
+ "method": false,
+ "shorthand": true,
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ }
+ ],
+ "range": [
+ 22,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 16,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-plus.js b/test/fixtures/ES6/yield/yield-arg-plus.js
new file mode 100644
index 0000000..5e86d42
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-plus.js
@@ -0,0 +1 @@
+function *g() { yield +x }
diff --git a/test/fixtures/ES6/yield/yield-arg-plus.tree.json b/test/fixtures/ES6/yield/yield-arg-plus.tree.json
new file mode 100644
index 0000000..1583840
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-plus.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "UnaryExpression",
+ "operator": "+",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 22,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-plusplus.js b/test/fixtures/ES6/yield/yield-arg-plusplus.js
new file mode 100644
index 0000000..597f1e8
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-plusplus.js
@@ -0,0 +1 @@
+function *g() { yield ++x }
diff --git a/test/fixtures/ES6/yield/yield-arg-plusplus.tree.json b/test/fixtures/ES6/yield/yield-arg-plusplus.tree.json
new file mode 100644
index 0000000..9a0e1c2
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-plusplus.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "UpdateExpression",
+ "operator": "++",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 22,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ "range": [
+ 16,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "++",
+ "range": [
+ 22,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-regexp1.js b/test/fixtures/ES6/yield/yield-arg-regexp1.js
new file mode 100644
index 0000000..e8f3016
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-regexp1.js
@@ -0,0 +1 @@
+function *g() { yield /x/i }
diff --git a/test/fixtures/ES6/yield/yield-arg-regexp1.tree.json b/test/fixtures/ES6/yield/yield-arg-regexp1.tree.json
new file mode 100644
index 0000000..7fda304
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-regexp1.tree.json
@@ -0,0 +1,303 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "Literal",
+ "value": {},
+ "raw": "/x/i",
+ "regex": {
+ "pattern": "x",
+ "flags": "i"
+ },
+ "range": [
+ 22,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ "range": [
+ 16,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "RegularExpression",
+ "value": "/x/i",
+ "range": [
+ 22,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "regex": {
+ "pattern": "x",
+ "flags": "i"
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-regexp2.js b/test/fixtures/ES6/yield/yield-arg-regexp2.js
new file mode 100644
index 0000000..efb4f7d
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-regexp2.js
@@ -0,0 +1 @@
+function *g() { yield /=x/i }
diff --git a/test/fixtures/ES6/yield/yield-arg-regexp2.tree.json b/test/fixtures/ES6/yield/yield-arg-regexp2.tree.json
new file mode 100644
index 0000000..a50a5da
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-regexp2.tree.json
@@ -0,0 +1,303 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "Literal",
+ "value": {},
+ "raw": "/=x/i",
+ "regex": {
+ "pattern": "=x",
+ "flags": "i"
+ },
+ "range": [
+ 22,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ },
+ "range": [
+ 16,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "RegularExpression",
+ "value": "/=x/i",
+ "range": [
+ 22,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ },
+ "regex": {
+ "pattern": "=x",
+ "flags": "i"
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-super.js b/test/fixtures/ES6/yield/yield-arg-super.js
new file mode 100644
index 0000000..bd7b41c
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-super.js
@@ -0,0 +1 @@
+class A { *b() { yield super.c(); } }
diff --git a/test/fixtures/ES6/yield/yield-arg-super.tree.json b/test/fixtures/ES6/yield/yield-arg-super.tree.json
new file mode 100644
index 0000000..577cb72
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-super.tree.json
@@ -0,0 +1,567 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "ClassDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "A",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ },
+ "superClass": null,
+ "body": {
+ "type": "ClassBody",
+ "body": [
+ {
+ "type": "MethodDefinition",
+ "key": {
+ "type": "Identifier",
+ "name": "b",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ "computed": false,
+ "value": {
+ "type": "FunctionExpression",
+ "id": null,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Super",
+ "range": [
+ 23,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ "property": {
+ "type": "Identifier",
+ "name": "c",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "range": [
+ 23,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "arguments": [],
+ "range": [
+ 23,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 17,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ "range": [
+ 17,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ }
+ }
+ ],
+ "range": [
+ 15,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 12,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ }
+ },
+ "kind": "method",
+ "static": false,
+ "range": [
+ 10,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ }
+ }
+ ],
+ "range": [
+ 8,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ }
+ },
+ "range": [
+ 0,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "class",
+ "range": [
+ 0,
+ 5
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "A",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 17,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 17
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "super",
+ "range": [
+ 23,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 23
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "c",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 30
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ";",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 1,
+ "column": 37
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-this.js b/test/fixtures/ES6/yield/yield-arg-this.js
new file mode 100644
index 0000000..35301e4
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-this.js
@@ -0,0 +1 @@
+function *g() { yield this }
diff --git a/test/fixtures/ES6/yield/yield-arg-this.tree.json b/test/fixtures/ES6/yield/yield-arg-this.tree.json
new file mode 100644
index 0000000..8bd472e
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-this.tree.json
@@ -0,0 +1,293 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "ThisExpression",
+ "range": [
+ 22,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ "range": [
+ 16,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 27
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "this",
+ "range": [
+ 22,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-typeof.js b/test/fixtures/ES6/yield/yield-arg-typeof.js
new file mode 100644
index 0000000..8ddd339
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-typeof.js
@@ -0,0 +1 @@
+function *g() { yield typeof x }
diff --git a/test/fixtures/ES6/yield/yield-arg-typeof.tree.json b/test/fixtures/ES6/yield/yield-arg-typeof.tree.json
new file mode 100644
index 0000000..dac3dc9
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-typeof.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "UnaryExpression",
+ "operator": "typeof",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 22,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "range": [
+ 16,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "typeof",
+ "range": [
+ 22,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/ES6/yield/yield-arg-void.js b/test/fixtures/ES6/yield/yield-arg-void.js
new file mode 100644
index 0000000..7cf1886
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-void.js
@@ -0,0 +1 @@
+function *g() { yield void x }
diff --git a/test/fixtures/ES6/yield/yield-arg-void.tree.json b/test/fixtures/ES6/yield/yield-arg-void.tree.json
new file mode 100644
index 0000000..a57f1ae
--- /dev/null
+++ b/test/fixtures/ES6/yield/yield-arg-void.tree.json
@@ -0,0 +1,331 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "FunctionDeclaration",
+ "id": {
+ "type": "Identifier",
+ "name": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "YieldExpression",
+ "argument": {
+ "type": "UnaryExpression",
+ "operator": "void",
+ "argument": {
+ "type": "Identifier",
+ "name": "x",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ "prefix": true,
+ "range": [
+ 22,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ "delegate": false,
+ "range": [
+ 16,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ "range": [
+ 16,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ }
+ ],
+ "range": [
+ 14,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ },
+ "generator": true,
+ "expression": false,
+ "range": [
+ 0,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ }
+ ],
+ "sourceType": "script",
+ "range": [
+ 0,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ },
+ "tokens": [
+ {
+ "type": "Keyword",
+ "value": "function",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "g",
+ "range": [
+ 10,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "yield",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "void",
+ "range": [
+ 22,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "x",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 27
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 1,
+ "column": 30
+ }
+ }
+ }
+ ]
+}
diff --git a/test/fixtures/invalid-syntax/migrated_0259.failure.json b/test/fixtures/invalid-syntax/migrated_0259.failure.json
deleted file mode 100644
index 21bb4a1..0000000
--- a/test/fixtures/invalid-syntax/migrated_0259.failure.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "index": 14,
- "lineNumber": 1,
- "column": 15,
- "message": "Error: Line 1: Unexpected token {"
-}
\ No newline at end of file
diff --git a/test/fixtures/invalid-syntax/migrated_0259.js b/test/fixtures/invalid-syntax/migrated_0259.js
deleted file mode 100644
index e2c4369..0000000
--- a/test/fixtures/invalid-syntax/migrated_0259.js
+++ /dev/null
@@ -1 +0,0 @@
-function x(...{ a }){}
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-esprima.git
More information about the Pkg-javascript-commits
mailing list