@@ -74,7 +74,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
74
74
* value = JsValue :: alternatives (
75
75
take ( alts)
76
76
. into_iter ( )
77
- . map ( |alt| JsValue :: member ( box alt, prop. clone ( ) ) )
77
+ . map ( |alt| JsValue :: member ( Box :: new ( alt) , prop. clone ( ) ) )
78
78
. collect ( ) ,
79
79
) ;
80
80
true
@@ -87,7 +87,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
87
87
} => {
88
88
fn items_to_alternatives ( items : & mut Vec < JsValue > , prop : & mut JsValue ) -> JsValue {
89
89
items. push ( JsValue :: unknown (
90
- JsValue :: member ( box JsValue :: array ( Vec :: new ( ) ) , box take ( prop) ) ,
90
+ JsValue :: member ( Box :: new ( JsValue :: array ( Vec :: new ( ) ) ) , Box :: new ( take ( prop) ) ) ,
91
91
"unknown array prototype methods or values" ,
92
92
) ) ;
93
93
JsValue :: alternatives ( take ( items) )
@@ -105,7 +105,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
105
105
true
106
106
} else {
107
107
* value = JsValue :: unknown (
108
- JsValue :: member ( box take ( obj) , box take ( prop) ) ,
108
+ JsValue :: member ( Box :: new ( take ( obj) ) , Box :: new ( take ( prop) ) ) ,
109
109
"invalid index" ,
110
110
) ;
111
111
true
@@ -127,7 +127,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
127
127
* value = JsValue :: alternatives (
128
128
take ( alts)
129
129
. into_iter ( )
130
- . map ( |alt| JsValue :: member ( box obj. clone ( ) , box alt) )
130
+ . map ( |alt| JsValue :: member ( Box :: new ( obj. clone ( ) ) , Box :: new ( alt) ) )
131
131
. collect ( ) ,
132
132
) ;
133
133
true
@@ -160,7 +160,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
160
160
ObjectPart :: Spread ( _) => {
161
161
values. push ( JsValue :: unknown (
162
162
JsValue :: member (
163
- box JsValue :: object ( vec ! [ take( part) ] ) ,
163
+ Box :: new ( JsValue :: object ( vec ! [ take( part) ] ) ) ,
164
164
prop. clone ( ) ,
165
165
) ,
166
166
"spreaded object" ,
@@ -170,7 +170,10 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
170
170
}
171
171
if include_unknown {
172
172
values. push ( JsValue :: unknown (
173
- JsValue :: member ( box JsValue :: object ( Vec :: new ( ) ) , box take ( prop) ) ,
173
+ JsValue :: member (
174
+ Box :: new ( JsValue :: object ( Vec :: new ( ) ) ) ,
175
+ Box :: new ( take ( prop) ) ,
176
+ ) ,
174
177
"unknown object prototype methods or values" ,
175
178
) ) ;
176
179
}
@@ -262,7 +265,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
262
265
* value = JsValue :: alternatives (
263
266
take ( alts)
264
267
. into_iter ( )
265
- . map ( |alt| JsValue :: member ( box obj. clone ( ) , box alt) )
268
+ . map ( |alt| JsValue :: member ( Box :: new ( obj. clone ( ) ) , Box :: new ( alt) ) )
266
269
. collect ( ) ,
267
270
) ;
268
271
true
@@ -336,7 +339,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
336
339
. enumerate ( )
337
340
. map ( |( i, item) | {
338
341
JsValue :: call (
339
- box func. clone ( ) ,
342
+ Box :: new ( func. clone ( ) ) ,
340
343
vec ! [
341
344
item,
342
345
JsValue :: Constant ( ConstantValue :: Num (
@@ -361,7 +364,11 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
361
364
take ( alts)
362
365
. into_iter ( )
363
366
. map ( |alt| {
364
- JsValue :: member_call ( box alt, box prop. clone ( ) , args. clone ( ) )
367
+ JsValue :: member_call (
368
+ Box :: new ( alt) ,
369
+ Box :: new ( prop. clone ( ) ) ,
370
+ args. clone ( ) ,
371
+ )
365
372
} )
366
373
. collect ( ) ,
367
374
) ;
@@ -372,7 +379,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
372
379
// without special handling, we convert it into a normal call like
373
380
// `(obj.prop)(arg1, arg2, ...)`
374
381
* value = JsValue :: call (
375
- box JsValue :: member ( box take ( obj) , box take ( prop) ) ,
382
+ Box :: new ( JsValue :: member ( Box :: new ( take ( obj) ) , Box :: new ( take ( prop) ) ) ) ,
376
383
take ( args) ,
377
384
) ;
378
385
true
@@ -383,7 +390,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
383
390
* value = JsValue :: alternatives (
384
391
take ( alts)
385
392
. into_iter ( )
386
- . map ( |alt| JsValue :: call ( box alt, args. clone ( ) ) )
393
+ . map ( |alt| JsValue :: call ( Box :: new ( alt) , args. clone ( ) ) )
387
394
. collect ( ) ,
388
395
) ;
389
396
true
0 commit comments