File tree Expand file tree Collapse file tree 4 files changed +25
-16
lines changed Expand file tree Collapse file tree 4 files changed +25
-16
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,8 @@ ListPrototype['@@transducer/result'] = function (obj) {
257
257
return obj . asImmutable ( ) ;
258
258
} ;
259
259
260
+ ListPrototype . __empty = emptyList ;
261
+
260
262
class VNode {
261
263
constructor ( array , ownerID ) {
262
264
this . array = array ;
Original file line number Diff line number Diff line change @@ -185,6 +185,8 @@ MapPrototype['@@transducer/result'] = function (obj) {
185
185
return obj . asImmutable ( ) ;
186
186
} ;
187
187
188
+ MapPrototype . __empty = emptyMap ;
189
+
188
190
// #pragma Trie Nodes
189
191
190
192
class ArrayMapNode {
Original file line number Diff line number Diff line change @@ -93,8 +93,11 @@ export class OrderedMap extends Map {
93
93
94
94
OrderedMap . isOrderedMap = isOrderedMap ;
95
95
96
- OrderedMap . prototype [ IS_ORDERED_SYMBOL ] = true ;
97
- OrderedMap . prototype [ DELETE ] = OrderedMap . prototype . remove ;
96
+ const OrderedMapPrototype = OrderedMap . prototype ;
97
+ OrderedMapPrototype [ IS_ORDERED_SYMBOL ] = true ;
98
+ OrderedMapPrototype [ DELETE ] = OrderedMapPrototype . remove ;
99
+
100
+ OrderedMapPrototype . __empty = emptyOrderedMap ;
98
101
99
102
function makeOrderedMap ( map , list , ownerID , hash ) {
100
103
const omap = Object . create ( OrderedMap . prototype ) ;
Original file line number Diff line number Diff line change @@ -192,6 +192,21 @@ export class Stack extends IndexedCollection {
192
192
}
193
193
}
194
194
195
+ function makeStack ( size , head , ownerID , hash ) {
196
+ const map = Object . create ( StackPrototype ) ;
197
+ map . size = size ;
198
+ map . _head = head ;
199
+ map . __ownerID = ownerID ;
200
+ map . __hash = hash ;
201
+ map . __altered = false ;
202
+ return map ;
203
+ }
204
+
205
+ let EMPTY_STACK ;
206
+ function emptyStack ( ) {
207
+ return EMPTY_STACK || ( EMPTY_STACK = makeStack ( 0 ) ) ;
208
+ }
209
+
195
210
Stack . isStack = isStack ;
196
211
197
212
const StackPrototype = Stack . prototype ;
@@ -210,17 +225,4 @@ StackPrototype['@@transducer/result'] = function (obj) {
210
225
return obj . asImmutable ( ) ;
211
226
} ;
212
227
213
- function makeStack ( size , head , ownerID , hash ) {
214
- const map = Object . create ( StackPrototype ) ;
215
- map . size = size ;
216
- map . _head = head ;
217
- map . __ownerID = ownerID ;
218
- map . __hash = hash ;
219
- map . __altered = false ;
220
- return map ;
221
- }
222
-
223
- let EMPTY_STACK ;
224
- function emptyStack ( ) {
225
- return EMPTY_STACK || ( EMPTY_STACK = makeStack ( 0 ) ) ;
226
- }
228
+ StackPrototype . __empty = emptyStack ;
You can’t perform that action at this time.
0 commit comments