@@ -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,7 @@ 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 ( Box :: new ( JsValue :: object ( Vec :: new ( ) ) ) , Box :: new ( take ( prop) ) ) ,
174
174
"unknown object prototype methods or values" ,
175
175
) ) ;
176
176
}
@@ -262,7 +262,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
262
262
* value = JsValue :: alternatives (
263
263
take ( alts)
264
264
. into_iter ( )
265
- . map ( |alt| JsValue :: member ( box obj. clone ( ) , box alt) )
265
+ . map ( |alt| JsValue :: member ( Box :: new ( obj. clone ( ) ) , Box :: new ( alt) ) )
266
266
. collect ( ) ,
267
267
) ;
268
268
true
@@ -336,7 +336,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
336
336
. enumerate ( )
337
337
. map ( |( i, item) | {
338
338
JsValue :: call (
339
- box func. clone ( ) ,
339
+ Box :: new ( func. clone ( ) ) ,
340
340
vec ! [
341
341
item,
342
342
JsValue :: Constant ( ConstantValue :: Num (
@@ -361,7 +361,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
361
361
take ( alts)
362
362
. into_iter ( )
363
363
. map ( |alt| {
364
- JsValue :: member_call ( box alt, box prop. clone ( ) , args. clone ( ) )
364
+ JsValue :: member_call ( Box :: new ( alt) , Box :: new ( prop. clone ( ) ) , args. clone ( ) )
365
365
} )
366
366
. collect ( ) ,
367
367
) ;
@@ -372,7 +372,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
372
372
// without special handling, we convert it into a normal call like
373
373
// `(obj.prop)(arg1, arg2, ...)`
374
374
* value = JsValue :: call (
375
- box JsValue :: member ( box take ( obj) , box take ( prop) ) ,
375
+ Box :: new ( JsValue :: member ( Box :: new ( take ( obj) ) , Box :: new ( take ( prop) ) ) ) ,
376
376
take ( args) ,
377
377
) ;
378
378
true
@@ -383,7 +383,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
383
383
* value = JsValue :: alternatives (
384
384
take ( alts)
385
385
. into_iter ( )
386
- . map ( |alt| JsValue :: call ( box alt, args. clone ( ) ) )
386
+ . map ( |alt| JsValue :: call ( Box :: new ( alt) , args. clone ( ) ) )
387
387
. collect ( ) ,
388
388
) ;
389
389
true
0 commit comments