mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-12 23:18:03 -05:00
Fix return copying
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
//! test_output(1)
|
||||
// Should be: 0
|
||||
//! test_output(0)
|
||||
|
||||
/// <reference path="../../../concept-code/vs.d.ts" />
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
use std::mem::take;
|
||||
|
||||
use valuescript_common::InstructionByte;
|
||||
|
||||
use crate::builtins::type_error_builtin::ToTypeError;
|
||||
@@ -135,8 +137,8 @@ impl StackFrameTrait for BytecodeStackFrame {
|
||||
match instruction_byte {
|
||||
End => {
|
||||
return Ok(FrameStepOk::Pop(CallResult {
|
||||
return_: self.registers[0].clone(),
|
||||
this: self.registers[1].clone(),
|
||||
return_: take(&mut self.registers[0]),
|
||||
this: take(&mut self.registers[1]),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user