Skip to content

Commit a9a8bfb

Browse files
avm2: Fix incorrect method return values/types for some native methods
- `Vector$object`'s `push` and `shift` should return `*`, not `Object` - `DisplayObjectContainer`'s `setChildIndex` returns `void`
1 parent cf250f7 commit a9a8bfb

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

core/src/avm2/globals/VectorObject.as

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ package __AS3__.vec {
170170

171171
AS3 native function map(callback:Function, receiver:Object = null):*;
172172

173-
AS3 native function pop():Object;
173+
AS3 native function pop():*;
174174

175175
AS3 native function push(... rest):uint;
176176

@@ -179,7 +179,7 @@ package __AS3__.vec {
179179

180180
AS3 native function reverse():Vector$object;
181181

182-
AS3 native function shift():Object;
182+
AS3 native function shift():*;
183183

184184
AS3 native function slice(start:Number = 0, end:Number = 2147483647):Vector$object;
185185

core/src/avm2/globals/flash/display/display_object_container.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,6 @@ pub fn set_child_index<'gc>(
443443

444444
validate_add_operation(activation, parent, child, target_index)?;
445445
add_child_to_displaylist(activation.context, parent, child, target_index);
446-
447-
return Ok(child.object2());
448446
}
449447

450448
Ok(Value::Undefined)

0 commit comments

Comments
 (0)