fix C# fork() error
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
#! /bin/bash
|
||||
mono bin/cs/test/bin/TestMain.exe || echo "C# tests failed"
|
||||
mono bin/cs/test/bin/TestMain.exe
|
@@ -212,7 +212,8 @@ class EmbeddedScript {
|
||||
var fork = new kiss.cloner.Cloner().clone(this);
|
||||
fork.instructions[instructionPointer] = command;
|
||||
if (fork.breakPoints == null) {
|
||||
throw 'cloning failed';
|
||||
// This field is so much trouble to clone in C# because of its type
|
||||
fork.breakPoints = [for (point => condition in this.breakPoints) point => condition];
|
||||
}
|
||||
// trace('running a fork from ' + Std.string(instructionPointer + 1));
|
||||
fork.run();
|
||||
|
@@ -100,13 +100,12 @@ class Cloner {
|
||||
var classValue = Type.getClass(inValue);
|
||||
var outValue:T = Type.createEmptyInstance(classValue);
|
||||
var fields:Array<String> = Type.getInstanceFields(classValue);
|
||||
for (i in 0...fields.length) {
|
||||
var field = fields[i];
|
||||
for (field in fields) {
|
||||
var property = Reflect.getProperty(inValue, field);
|
||||
try {
|
||||
Reflect.setField(outValue, field, _clone(property));
|
||||
} catch (s) {
|
||||
// There will be errors on C++ when trying to assign to a member function.
|
||||
// There will be errors on C++ and C# when trying to assign to a member function.
|
||||
// They're not important, because the function will already be on the clone.
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user