fix parsing of yield as object key (#1976)

fixes #1974
This commit is contained in:
Alex Lam S.L
2017-05-20 13:11:37 +08:00
committed by GitHub
parent 9a074c2637
commit a2172e1a99
3 changed files with 16 additions and 7 deletions

View File

@@ -190,3 +190,12 @@ yield_sub: {
}
expect_exact: 'function*foo(){yield x["foo"];(yield x)["foo"];yield(yield obj.foo())["bar"]()}'
}
yield_as_ES5_property: {
input: {
"use strict";
console.log({yield: 42}.yield);
}
expect_exact: '"use strict";console.log({yield:42}.yield);'
expect_stdout: "42"
}