-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a back door to opt out of the packed array argument checking via …
…an attribute. Make JSILc return a non-zero exit code if non-fatal errors occurred during translation.
- Loading branch information
Showing
6 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Tests/FailingTestCases/PassNormalArrayAsPackedArrayArgument.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using JSIL.Meta; | ||
|
||
public struct IntFloatPair { | ||
public int Int; | ||
public float Float; | ||
|
||
public override string ToString () { | ||
return String.Format("Int={0:0000}, Float={1:000.000}", Int, Float); | ||
} | ||
} | ||
|
||
public static class Program { | ||
public static IntFloatPair[] PackedArray = new IntFloatPair[2]; | ||
|
||
public static unsafe void Main (string[] args) { | ||
FillPackedArray(PackedArray); | ||
|
||
foreach (var item in PackedArray) | ||
Console.WriteLine(item); | ||
} | ||
|
||
[JSPackedArrayArguments("array")] | ||
public static void FillPackedArray (IntFloatPair[] array) { | ||
Console.WriteLine(array.Length); | ||
} | ||
} |