@@ -74,7 +74,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
7474 * value = JsValue :: alternatives (
7575 take ( alts)
7676 . into_iter ( )
77- . map ( |alt| JsValue :: member ( box alt, prop. clone ( ) ) )
77+ . map ( |alt| JsValue :: member ( Box :: new ( alt) , prop. clone ( ) ) )
7878 . collect ( ) ,
7979 ) ;
8080 true
@@ -87,7 +87,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
8787 } => {
8888 fn items_to_alternatives ( items : & mut Vec < JsValue > , prop : & mut JsValue ) -> JsValue {
8989 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) ) ) ,
9191 "unknown array prototype methods or values" ,
9292 ) ) ;
9393 JsValue :: alternatives ( take ( items) )
@@ -105,7 +105,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
105105 true
106106 } else {
107107 * value = JsValue :: unknown (
108- JsValue :: member ( box take ( obj) , box take ( prop) ) ,
108+ JsValue :: member ( Box :: new ( take ( obj) ) , Box :: new ( take ( prop) ) ) ,
109109 "invalid index" ,
110110 ) ;
111111 true
@@ -127,7 +127,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
127127 * value = JsValue :: alternatives (
128128 take ( alts)
129129 . into_iter ( )
130- . map ( |alt| JsValue :: member ( box obj. clone ( ) , box alt) )
130+ . map ( |alt| JsValue :: member ( Box :: new ( obj. clone ( ) ) , Box :: new ( alt) ) )
131131 . collect ( ) ,
132132 ) ;
133133 true
@@ -160,7 +160,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
160160 ObjectPart :: Spread ( _) => {
161161 values. push ( JsValue :: unknown (
162162 JsValue :: member (
163- box JsValue :: object ( vec ! [ take( part) ] ) ,
163+ Box :: new ( JsValue :: object ( vec ! [ take( part) ] ) ) ,
164164 prop. clone ( ) ,
165165 ) ,
166166 "spreaded object" ,
@@ -170,7 +170,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
170170 }
171171 if include_unknown {
172172 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) ) ) ,
174174 "unknown object prototype methods or values" ,
175175 ) ) ;
176176 }
@@ -262,7 +262,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
262262 * value = JsValue :: alternatives (
263263 take ( alts)
264264 . into_iter ( )
265- . map ( |alt| JsValue :: member ( box obj. clone ( ) , box alt) )
265+ . map ( |alt| JsValue :: member ( Box :: new ( obj. clone ( ) ) , Box :: new ( alt) ) )
266266 . collect ( ) ,
267267 ) ;
268268 true
@@ -336,7 +336,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
336336 . enumerate ( )
337337 . map ( |( i, item) | {
338338 JsValue :: call (
339- box func. clone ( ) ,
339+ Box :: new ( func. clone ( ) ) ,
340340 vec ! [
341341 item,
342342 JsValue :: Constant ( ConstantValue :: Num (
@@ -361,7 +361,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
361361 take ( alts)
362362 . into_iter ( )
363363 . 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 ( ) )
365365 } )
366366 . collect ( ) ,
367367 ) ;
@@ -372,7 +372,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
372372 // without special handling, we convert it into a normal call like
373373 // `(obj.prop)(arg1, arg2, ...)`
374374 * 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) ) ) ) ,
376376 take ( args) ,
377377 ) ;
378378 true
@@ -383,7 +383,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
383383 * value = JsValue :: alternatives (
384384 take ( alts)
385385 . into_iter ( )
386- . map ( |alt| JsValue :: call ( box alt, args. clone ( ) ) )
386+ . map ( |alt| JsValue :: call ( Box :: new ( alt) , args. clone ( ) ) )
387387 . collect ( ) ,
388388 ) ;
389389 true
0 commit comments