This repository was archived by the owner on Oct 15, 2020. It is now read-only.
Commit fb1f064
deps: update ChakraCore to chakra-core/ChakraCore@24928c5041
[1.8>1.9] [MERGE #4628 @boingoing] Defer parse treats yield as keyword
Merge pull request #4628 from boingoing:DeferParseYieldToken
When we're defer parsing a function, we construct an enclosing function context to use as a parent function. That dummy parent function does not initialize the function flags, though, so they're random. When we're parsing a deferred lambda function, we look at those flags in the dummy parent function to see if it was a generator function to know if we should treat yield as an identifier or not. Because the flags are random, we sometimes throw a syntax error here thinking yield should be treated as a keyword. If we throw a syntax error upon defer-parse, we will hit an assert.
Fix by storing a bit of state in the ScopeInfo which indicates if the enclosing function is a generator or is an async function.
Fixes:
https://microsoft.visualstudio.com/web/wi.aspx?id=14502906
Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>1 parent d220b32 commit fb1f064
File tree
5 files changed
+78
-2
lines changed- deps/chakrashim/core
- lib
- Parser
- Runtime/ByteCode
- test/es6
5 files changed
+78
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11611 | 11611 | | |
11612 | 11612 | | |
11613 | 11613 | | |
| 11614 | + | |
| 11615 | + | |
| 11616 | + | |
| 11617 | + | |
11614 | 11618 | | |
11615 | 11619 | | |
11616 | 11620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | | - | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
262 | 274 | | |
263 | 275 | | |
264 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
113 | 161 | | |
114 | 162 | | |
115 | 163 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
831 | 831 | | |
832 | 832 | | |
833 | 833 | | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
834 | 841 | | |
835 | 842 | | |
836 | 843 | | |
| |||
0 commit comments