Skip to content
Myr

es5.ts

This file

Path

src/plugins/es5.ts

313 lines · 9.0 KiB · TypeScript

Last changed by

Preserve error codes in productionMichel Weststratebefore adoptiond005fab

History of this file

Take it

More WIPMichel Weststratebefore adoptionee1c977

lines 1–6why, one step back
1import {
2 ImmerState,3 Drafted,4 Objectish,5 ES5ArrayState,6 ES5ObjectState,

TSDXMichel Weststratebefore adoption4c4fecc

lines 7–15why, one step back
7 each,
8 has,9 isDraft,10 isDraftable,11 shallowCopy,12 latest,13 DRAFT_STATE,14 is,15 loadPlugin,

New build set. Current statsMichel Weststratebefore adoption9aec0fe

line 16why, one step back
16 ImmerScope,

Killed enumerations -145 (!)Michel Weststratebefore adoptionfdc78db

lines 17–18why, one step back
17 createProxy,
18 ProxyTypeES5Array,

Some minor cleanupMichel Weststratebefore adoption718b7f6

line 19why, one step back
19 ProxyTypeES5Object,

Preserve error codes in productionMichel Weststratebefore adoptiond005fab

lines 20–21why, one step back
20 AnyObject,
21 die

More WIPMichel Weststratebefore adoptionee1c977

lines 22–25why, one step back
22} from "../internal"
2324type ES5State = ES5ArrayState | ES5ObjectState25

TSDXMichel Weststratebefore adoption4c4fecc

line 26why, one step back
26export function enableES5() {

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 27why, one step back
27 function willFinalizeES5_(

TSDXMichel Weststratebefore adoption4c4fecc

lines 28–31why, one step back
28 scope: ImmerScope,
29 result: any,30 isReplaced: boolean31 ) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 32–33why, one step back
32 scope.drafts_!.forEach((draft: any) => {
33 ;(draft[DRAFT_STATE] as ES5State).finalizing_ = true

TSDXMichel Weststratebefore adoption4c4fecc

lines 34–35why, one step back
34 })
35 if (!isReplaced) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 36–37why, one step back
36 if (scope.patches_) {
37 markChangesRecursively(scope.drafts_![0])

More WIPMichel Weststratebefore adoptionee1c977

line 38why, one step back
38 }

TSDXMichel Weststratebefore adoption4c4fecc

line 39why, one step back
39 // This is faster when we don't care about which attributes changed.

Small improvementsMichel Weststratebefore adoption712af5c

line 40why, one step back
40 // TODO: should be prefixed with else!

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 41why, one step back
41 markChangesSweep(scope.drafts_)

More WIPMichel Weststratebefore adoptionee1c977

line 42why, one step back
42 }

TSDXMichel Weststratebefore adoption4c4fecc

line 43why, one step back
43 // When a child draft is returned, look for changes.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 44–48why, one step back
44 else if (
45 isDraft(result) &&46 (result[DRAFT_STATE] as ES5State).scope_ === scope47 ) {48 markChangesSweep(scope.drafts_)

TSDXMichel Weststratebefore adoption4c4fecc

lines 49–50why, one step back
49 }
50 }

More WIPMichel Weststratebefore adoptionee1c977

line 51why, one step back
51

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 52why, one step back
52 function createES5Proxy_<T>(

TSDXMichel Weststratebefore adoption4c4fecc

lines 53–56why, one step back
53 base: T,
54 parent?: ImmerState55 ): Drafted<T, ES5ObjectState | ES5ArrayState> {56 const isArray = Array.isArray(base)

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 57why, one step back
57 const draft: any = clonePotentialDraft(base)

More WIPMichel Weststratebefore adoptionee1c977

line 58why, one step back
58

TSDXMichel Weststratebefore adoption4c4fecc

lines 59–61why, one step back
59 each(draft, prop => {
60 proxyProperty(draft, prop, isArray || isEnumerable(base, prop))61 })

More WIPMichel Weststratebefore adoptionee1c977

line 62why, one step back
62

TSDXMichel Weststratebefore adoption4c4fecc

line 63why, one step back
63 const state: ES5ObjectState | ES5ArrayState = {

Killed enumerations -145 (!)Michel Weststratebefore adoptionfdc78db

line 64why, one step back
64 type_: isArray ? ProxyTypeES5Array : (ProxyTypeES5Object as any),

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 65–75why, one step back
65 scope_: parent ? parent.scope_ : ImmerScope.current_!,
66 modified_: false,67 finalizing_: false,68 finalized_: false,69 assigned_: {},70 parent_: parent,71 base_: base,72 draft_: draft,73 copy_: null,74 revoked_: false,75 isManual_: false

More WIPMichel Weststratebefore adoptionee1c977

lines 76–77why, one step back
76 }
77

Some minor cleanupMichel Weststratebefore adoption718b7f6

lines 78–82why, one step back
78 Object.defineProperty(draft, DRAFT_STATE, {
79 value: state,80 // enumerable: false <- the default81 writable: true82 })

TSDXMichel Weststratebefore adoption4c4fecc

lines 83–84why, one step back
83 return draft
84 }

More WIPMichel Weststratebefore adoptionee1c977

line 85why, one step back
85

TSDXMichel Weststratebefore adoption4c4fecc

lines 86–87why, one step back
86 // Access a property without creating an Immer draft.
87 function peek(draft: Drafted, prop: PropertyKey) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 88–90why, one step back
88 const state: ES5State = draft[DRAFT_STATE]
89 if (state && !state.finalizing_) {90 state.finalizing_ = true

TSDXMichel Weststratebefore adoption4c4fecc

line 91why, one step back
91 const value = draft[prop]

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 92why, one step back
92 state.finalizing_ = false

More WIPMichel Weststratebefore adoptionee1c977

lines 93–94why, one step back
93 return value
94 }

TSDXMichel Weststratebefore adoption4c4fecc

lines 95–96why, one step back
95 return draft[prop]
96 }

More WIPMichel Weststratebefore adoptionee1c977

line 97why, one step back
97

TSDXMichel Weststratebefore adoption4c4fecc

lines 98–100why, one step back
98 function get(state: ES5State, prop: string | number) {
99 assertUnrevoked(state)100 const value = peek(latest(state), prop)

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 101why, one step back
101 if (state.finalizing_) return value

TSDXMichel Weststratebefore adoption4c4fecc

line 102why, one step back
102 // Create a draft if the value is unmodified.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 103why, one step back
103 if (value === peek(state.base_, prop) && isDraftable(value)) {

TSDXMichel Weststratebefore adoption4c4fecc

line 104why, one step back
104 prepareCopy(state)

More WIPMichel Weststratebefore adoptionee1c977

line 105why, one step back
105 // @ts-ignore

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 106–110why, one step back
106 return (state.copy_![prop] = createProxy(
107 state.scope_.immer_,108 value,109 state110 ))

More WIPMichel Weststratebefore adoptionee1c977

line 111why, one step back
111 }

TSDXMichel Weststratebefore adoption4c4fecc

lines 112–113why, one step back
112 return value
113 }

More WIPMichel Weststratebefore adoptionee1c977

line 114why, one step back
114

TSDXMichel Weststratebefore adoption4c4fecc

lines 115–116why, one step back
115 function set(state: ES5State, prop: string | number, value: any) {
116 assertUnrevoked(state)

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 117–118why, one step back
117 state.assigned_[prop] = true
118 if (!state.modified_) {

TSDXMichel Weststratebefore adoption4c4fecc

line 119why, one step back
119 if (is(value, peek(latest(state), prop))) return

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 120why, one step back
120 markChangedES5_(state)

TSDXMichel Weststratebefore adoption4c4fecc

line 121why, one step back
121 prepareCopy(state)

More WIPMichel Weststratebefore adoptionee1c977

line 122why, one step back
122 }

TSDXMichel Weststratebefore adoption4c4fecc

line 123why, one step back
123 // @ts-ignore

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 124why, one step back
124 state.copy_![prop] = value

TSDXMichel Weststratebefore adoption4c4fecc

line 125why, one step back
125 }

More WIPMichel Weststratebefore adoptionee1c977

line 126why, one step back
126

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 127why, one step back
127 function markChangedES5_(state: ImmerState) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 128–129why, one step back
128 if (!state.modified_) {
129 state.modified_ = true

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 130why, one step back
130 if (state.parent_) markChangedES5_(state.parent_)

More WIPMichel Weststratebefore adoptionee1c977

line 131why, one step back
131 }

TSDXMichel Weststratebefore adoption4c4fecc

line 132why, one step back
132 }

More WIPMichel Weststratebefore adoptionee1c977

line 133why, one step back
133

TSDXMichel Weststratebefore adoption4c4fecc

line 134why, one step back
134 function prepareCopy(state: ES5State) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 135why, one step back
135 if (!state.copy_) state.copy_ = clonePotentialDraft(state.base_)

TSDXMichel Weststratebefore adoption4c4fecc

lines 136–138why, one step back
136 }
137138 function clonePotentialDraft(base: Objectish) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 139why, one step back
139 const state: ES5State | undefined = base && (base as any)[DRAFT_STATE]

TSDXMichel Weststratebefore adoption4c4fecc

line 140why, one step back
140 if (state) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 141–143why, one step back
141 state.finalizing_ = true
142 const draft = shallowCopy(state.draft_, true)143 state.finalizing_ = false

TSDXMichel Weststratebefore adoption4c4fecc

line 144why, one step back
144 return draft

More WIPMichel Weststratebefore adoptionee1c977

line 145why, one step back
145 }

TSDXMichel Weststratebefore adoption4c4fecc

lines 146–147why, one step back
146 return shallowCopy(base)
147 }

More WIPMichel Weststratebefore adoptionee1c977

line 148why, one step back
148

TSDXMichel Weststratebefore adoption4c4fecc

lines 149–151why, one step back
149 // property descriptors are recycled to make sure we don't create a get and set closure per property,
150 // but share them all instead151 const descriptors: {[prop: string]: PropertyDescriptor} = {}

More WIPMichel Weststratebefore adoptionee1c977

line 152why, one step back
152

TSDXMichel Weststratebefore adoption4c4fecc

lines 153–162why, one step back
153 function proxyProperty(
154 draft: Drafted<any, ES5State>,155 prop: string | number,156 enumerable: boolean157 ) {158 let desc = descriptors[prop]159 if (desc) {160 desc.enumerable = enumerable161 } else {162 descriptors[prop] = desc = {

Some notesMichel Weststratebefore adoption746dc6f

line 163why, one step back
163 // configurable: true,

TSDXMichel Weststratebefore adoption4c4fecc

lines 164–169why, one step back
164 enumerable,
165 get(this: any) {166 return get(this[DRAFT_STATE], prop)167 },168 set(this: any, value) {169 set(this[DRAFT_STATE], prop, value)

More WIPMichel Weststratebefore adoptionee1c977

lines 170–172why, one step back
170 }
171 }172 }

TSDXMichel Weststratebefore adoption4c4fecc

lines 173–174why, one step back
173 Object.defineProperty(draft, prop, desc)
174 }

More WIPMichel Weststratebefore adoptionee1c977

line 175why, one step back
175

TSDXMichel Weststratebefore adoption4c4fecc

lines 176–182why, one step back
176 // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
177 function markChangesSweep(drafts: Drafted<any, ImmerState>[]) {178 // The natural order of drafts in the `scope` array is based on when they179 // were accessed. By processing drafts in reverse natural order, we have a180 // better chance of processing leaf nodes first. When a leaf node is known to181 // have changed, we can avoid any traversal of its ancestor nodes.182 for (let i = drafts.length - 1; i >= 0; i--) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 183–185why, one step back
183 const state: ES5State = drafts[i][DRAFT_STATE]
184 if (!state.modified_) {185 switch (state.type_) {

Killed enumerations -145 (!)Michel Weststratebefore adoptionfdc78db

line 186why, one step back
186 case ProxyTypeES5Array:

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 187why, one step back
187 if (hasArrayChanges(state)) markChangedES5_(state)

TSDXMichel Weststratebefore adoption4c4fecc

line 188why, one step back
188 break

Killed enumerations -145 (!)Michel Weststratebefore adoptionfdc78db

line 189why, one step back
189 case ProxyTypeES5Object:

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 190why, one step back
190 if (hasObjectChanges(state)) markChangedES5_(state)

TSDXMichel Weststratebefore adoption4c4fecc

line 191why, one step back
191 break

More WIPMichel Weststratebefore adoptionee1c977

lines 192–194why, one step back
192 }
193 }194 }

TSDXMichel Weststratebefore adoption4c4fecc

line 195why, one step back
195 }

More WIPMichel Weststratebefore adoptionee1c977

line 196why, one step back
196

TSDXMichel Weststratebefore adoption4c4fecc

lines 197–198why, one step back
197 function markChangesRecursively(object: any) {
198 if (!object || typeof object !== "object") return

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 199why, one step back
199 const state: ES5State | undefined = object[DRAFT_STATE]

TSDXMichel Weststratebefore adoption4c4fecc

line 200why, one step back
200 if (!state) return

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 201why, one step back
201 const {base_, draft_, assigned_, type_} = state

Killed enumerations -145 (!)Michel Weststratebefore adoptionfdc78db

line 202why, one step back
202 if (type_ === ProxyTypeES5Object) {

TSDXMichel Weststratebefore adoption4c4fecc

lines 203–207why, one step back
203 // Look for added keys.
204 // TODO: looks quite duplicate to hasObjectChanges,205 // probably there is a faster way to detect changes, as sweep + recurse seems to do some206 // unnecessary work.207 // also: probably we can store the information we detect here, to speed up tree finalization!

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 208why, one step back
208 each(draft_, key => {

TSDXMichel Weststratebefore adoption4c4fecc

lines 209–210why, one step back
209 if ((key as any) === DRAFT_STATE) return
210 // The `undefined` check is a fast path for pre-existing keys.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 211–212why, one step back
211 if ((base_ as any)[key] === undefined && !has(base_, key)) {
212 assigned_[key] = true

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 213why, one step back
213 markChangedES5_(state)

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 214why, one step back
214 } else if (!assigned_[key]) {

TSDXMichel Weststratebefore adoption4c4fecc

line 215why, one step back
215 // Only untouched properties trigger recursion.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 216why, one step back
216 markChangesRecursively(draft_[key])

More WIPMichel Weststratebefore adoptionee1c977

line 217why, one step back
217 }

TSDXMichel Weststratebefore adoption4c4fecc

lines 218–219why, one step back
218 })
219 // Look for removed keys.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 220why, one step back
220 each(base_, key => {

TSDXMichel Weststratebefore adoption4c4fecc

line 221why, one step back
221 // The `undefined` check is a fast path for pre-existing keys.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 222–223why, one step back
222 if (draft_[key] === undefined && !has(draft_, key)) {
223 assigned_[key] = false

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 224why, one step back
224 markChangedES5_(state)

More WIPMichel Weststratebefore adoptionee1c977

line 225why, one step back
225 }

TSDXMichel Weststratebefore adoption4c4fecc

line 226why, one step back
226 })

Killed enumerations -145 (!)Michel Weststratebefore adoptionfdc78db

line 227why, one step back
227 } else if (type_ === ProxyTypeES5Array) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 228why, one step back
228 if (hasArrayChanges(state as ES5ArrayState)) {

scramble plugin names, -56Michel Weststratebefore adoption037b474

line 229why, one step back
229 markChangedES5_(state)

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 230why, one step back
230 assigned_.length = true

TSDXMichel Weststratebefore adoption4c4fecc

line 231why, one step back
231 }

More WIPMichel Weststratebefore adoptionee1c977

line 232why, one step back
232

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 233–234why, one step back
233 if (draft_.length < base_.length) {
234 for (let i = draft_.length; i < base_.length; i++) assigned_[i] = false

TSDXMichel Weststratebefore adoption4c4fecc

line 235why, one step back
235 } else {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 236why, one step back
236 for (let i = base_.length; i < draft_.length; i++) assigned_[i] = true

TSDXMichel Weststratebefore adoption4c4fecc

line 237why, one step back
237 }

More WIPMichel Weststratebefore adoptionee1c977

line 238why, one step back
238

TSDXMichel Weststratebefore adoption4c4fecc

line 239why, one step back
239 // Minimum count is enough, the other parts has been processed.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 240why, one step back
240 const min = Math.min(draft_.length, base_.length)

TSDXMichel Weststratebefore adoption4c4fecc

lines 241–243why, one step back
241
242 for (let i = 0; i < min; i++) {243 // Only untouched indices trigger recursion.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 244why, one step back
244 if (assigned_[i] === undefined) markChangesRecursively(draft_[i])

More WIPMichel Weststratebefore adoptionee1c977

lines 245–246why, one step back
245 }
246 }

TSDXMichel Weststratebefore adoption4c4fecc

line 247why, one step back
247 }

More WIPMichel Weststratebefore adoptionee1c977

line 248why, one step back
248

TSDXMichel Weststratebefore adoption4c4fecc

line 249why, one step back
249 function hasObjectChanges(state: ES5ObjectState) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 250why, one step back
250 const {base_, draft_} = state

More WIPMichel Weststratebefore adoptionee1c977

line 251why, one step back
251

TSDXMichel Weststratebefore adoption4c4fecc

lines 252–253why, one step back
252 // Search for added keys and changed keys. Start at the back, because
253 // non-numeric keys are ordered by time of definition on the object.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 254why, one step back
254 const keys = Object.keys(draft_)

TSDXMichel Weststratebefore adoption4c4fecc

lines 255–256why, one step back
255 for (let i = keys.length - 1; i >= 0; i--) {
256 const key = keys[i]

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 257why, one step back
257 const baseValue = base_[key]

TSDXMichel Weststratebefore adoption4c4fecc

line 258why, one step back
258 // The `undefined` check is a fast path for pre-existing keys.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 259why, one step back
259 if (baseValue === undefined && !has(base_, key)) {

TSDXMichel Weststratebefore adoption4c4fecc

lines 260–264why, one step back
260 return true
261 }262 // Once a base key is deleted, future changes go undetected, because its263 // descriptor is erased. This branch detects any missed changes.264 else {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 265–267why, one step back
265 const value = draft_[key]
266 const state: ImmerState = value && value[DRAFT_STATE]267 if (state ? state.base_ !== baseValue : !is(value, baseValue)) {

More WIPMichel Weststratebefore adoptionee1c977

lines 268–272why, one step back
268 return true
269 }270 }271 }272

TSDXMichel Weststratebefore adoption4c4fecc

lines 273–274why, one step back
273 // At this point, no keys were added or changed.
274 // Compare key count to determine if keys were deleted.

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

line 275why, one step back
275 return keys.length !== Object.keys(base_).length

TSDXMichel Weststratebefore adoption4c4fecc

line 276why, one step back
276 }

More WIPMichel Weststratebefore adoptionee1c977

line 277why, one step back
277

TSDXMichel Weststratebefore adoption4c4fecc

line 278why, one step back
278 function hasArrayChanges(state: ES5ArrayState) {

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 279–280why, one step back
279 const {draft_} = state
280 if (draft_.length !== state.base_.length) return true

TSDXMichel Weststratebefore adoption4c4fecc

lines 281–287why, one step back
281 // See #116
282 // If we first shorten the length, our array interceptors will be removed.283 // If after that new items are added, result in the same original length,284 // those last items will have no intercepting property.285 // So if there is no own descriptor on the last position, we know that items were removed and added286 // N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check287 // the last one

Mangle properties, -114 bytesMichel Weststratebefore adoptionbfa7ddd

lines 288–291why, one step back
288 const descriptor = Object.getOwnPropertyDescriptor(
289 draft_,290 draft_.length - 1291 )

TSDXMichel Weststratebefore adoption4c4fecc

lines 292–295why, one step back
292 // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
293 if (descriptor && !descriptor.get) return true294 // For all other cases, we don't have to compare, as they would have been picked up by the index setters295 return false

Some minor cleanupMichel Weststratebefore adoption718b7f6

lines 296–301why, one step back
296 }
297298 /*#__PURE__*/299 function isEnumerable(base: AnyObject, prop: PropertyKey): boolean {300 const desc = Object.getOwnPropertyDescriptor(base, prop)301 return desc && desc.enumerable ? true : false

Preserve error codes in productionMichel Weststratebefore adoptiond005fab

lines 302–305why, one step back
302 }
303304 function assertUnrevoked(state: any /*ES5State | MapState | SetState*/) {305 if (state.revoked_) die(3, JSON.stringify(latest(state)))

More WIPMichel Weststratebefore adoptionee1c977

line 306why, one step back
306 }

TSDXMichel Weststratebefore adoption4c4fecc

lines 307–308why, one step back
307
308 loadPlugin("es5", {

scramble plugin names, -56Michel Weststratebefore adoption037b474

lines 309–311why, one step back
309 createES5Proxy_,
310 markChangedES5_,311 willFinalizeES5_

TSDXMichel Weststratebefore adoption4c4fecc

lines 312–313why, one step back
312 })
313}