diff --git a/src/JavaScriptCore/Enums.cs b/src/JavaScriptCore/Enums.cs index 197b6e36c251..2535c4854014 100644 --- a/src/JavaScriptCore/Enums.cs +++ b/src/JavaScriptCore/Enums.cs @@ -23,6 +23,8 @@ public enum JSType { [iOS (13, 0)] [MacCatalyst (13, 1)] Symbol, + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + BigInt, } // typedef unsigned -> JSObjectRef.h @@ -42,4 +44,12 @@ public enum JSClassAttributes : uint { None = 0, NoAutomaticPrototype = 1 << 1 } + + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + public enum JSRelationCondition : uint { + Undefined, + Equal, + GreaterThan, + LessThan, + } } diff --git a/src/javascriptcore.cs b/src/javascriptcore.cs index 435ab73082f9..7130ef524a9c 100644 --- a/src/javascriptcore.cs +++ b/src/javascriptcore.cs @@ -187,6 +187,14 @@ partial interface JSValue { [Export ("toUInt32")] uint ToUInt32 (); + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("toInt64")] + long ToInt64 (); + + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("toUInt64")] + ulong ToUInt64 (); + [Export ("toNumber")] NSNumber ToNumber (); @@ -333,6 +341,50 @@ partial interface JSValue { [MacCatalyst (13, 1)] [Export ("isSymbol")] bool IsSymbol { get; } + + [Static] + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("valueWithNewBigIntFromString:inContext:")] + [return: NullAllowed] + JSValue CreateNewBigInt (string @string, JSContext context); + + [Static] + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("valueWithNewBigIntFromInt64:inContext:")] + [return: NullAllowed] + JSValue CreateNewBigInt (long int64, JSContext context); + + [Static] + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("valueWithNewBigIntFromUInt64:inContext:")] + [return: NullAllowed] + JSValue CreateNewBigInt (ulong uint64, JSContext context); + + [Static] + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("valueWithNewBigIntFromDouble:inContext:")] + [return: NullAllowed] + JSValue CreateNewBigInt (double uint64, JSContext context); + + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("isBigInt")] + bool IsBigInt { get; } + + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("compareJSValue:")] + JSRelationCondition Compare (JSValue other); + + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("compareInt64:")] + JSRelationCondition Compare (long other); + + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("compareUInt64:")] + JSRelationCondition Compare (ulong other); + + [iOS (18, 0), MacCatalyst (18, 0), TV (18, 0), NoMac] + [Export ("compareDouble:")] + JSRelationCondition Compare (double other); } /// Class that maintains a binding between a JavaScript and Objective-C value. diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index 02b319f8b466..f122fa01b2ef 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -13174,6 +13174,11 @@ F:JavaScriptCore.JSPropertyAttributes.DontDelete F:JavaScriptCore.JSPropertyAttributes.DontEnum F:JavaScriptCore.JSPropertyAttributes.None F:JavaScriptCore.JSPropertyAttributes.ReadOnly +F:JavaScriptCore.JSRelationCondition.Equal +F:JavaScriptCore.JSRelationCondition.GreaterThan +F:JavaScriptCore.JSRelationCondition.LessThan +F:JavaScriptCore.JSRelationCondition.Undefined +F:JavaScriptCore.JSType.BigInt F:JavaScriptCore.JSType.Boolean F:JavaScriptCore.JSType.Null F:JavaScriptCore.JSType.Number @@ -38664,9 +38669,17 @@ M:JavaScriptCore.JSManagedValue.#ctor(JavaScriptCore.JSValue) M:JavaScriptCore.JSManagedValue.Get(JavaScriptCore.JSValue,Foundation.NSObject) M:JavaScriptCore.JSManagedValue.Get(JavaScriptCore.JSValue) M:JavaScriptCore.JSValue.Call(JavaScriptCore.JSValue[]) +M:JavaScriptCore.JSValue.Compare(JavaScriptCore.JSValue) +M:JavaScriptCore.JSValue.Compare(System.Double) +M:JavaScriptCore.JSValue.Compare(System.Int64) +M:JavaScriptCore.JSValue.Compare(System.UInt64) M:JavaScriptCore.JSValue.Construct(JavaScriptCore.JSValue[]) M:JavaScriptCore.JSValue.CreateArray(JavaScriptCore.JSContext) M:JavaScriptCore.JSValue.CreateError(System.String,JavaScriptCore.JSContext) +M:JavaScriptCore.JSValue.CreateNewBigInt(System.Double,JavaScriptCore.JSContext) +M:JavaScriptCore.JSValue.CreateNewBigInt(System.Int64,JavaScriptCore.JSContext) +M:JavaScriptCore.JSValue.CreateNewBigInt(System.String,JavaScriptCore.JSContext) +M:JavaScriptCore.JSValue.CreateNewBigInt(System.UInt64,JavaScriptCore.JSContext) M:JavaScriptCore.JSValue.CreateObject(JavaScriptCore.JSContext) M:JavaScriptCore.JSValue.CreatePromise(JavaScriptCore.JSContext,JavaScriptCore.JSPromiseCreationExecutor) M:JavaScriptCore.JSValue.CreateRegularExpression(System.String,System.String,JavaScriptCore.JSContext) @@ -38702,6 +38715,7 @@ M:JavaScriptCore.JSValue.ToDate M:JavaScriptCore.JSValue.ToDictionary M:JavaScriptCore.JSValue.ToDouble M:JavaScriptCore.JSValue.ToInt32 +M:JavaScriptCore.JSValue.ToInt64 M:JavaScriptCore.JSValue.ToNumber M:JavaScriptCore.JSValue.ToObject M:JavaScriptCore.JSValue.ToObject(ObjCRuntime.Class) @@ -38711,6 +38725,7 @@ M:JavaScriptCore.JSValue.ToRect M:JavaScriptCore.JSValue.ToSize M:JavaScriptCore.JSValue.ToString M:JavaScriptCore.JSValue.ToUInt32 +M:JavaScriptCore.JSValue.ToUInt64 M:JavaScriptCore.JSValue.Undefined(JavaScriptCore.JSContext) M:JavaScriptCore.JSVirtualMachine.#ctor M:JavaScriptCore.JSVirtualMachine.AddManagedReference(Foundation.NSObject,Foundation.NSObject) @@ -68141,6 +68156,7 @@ P:JavaScriptCore.JSPropertyDescriptorKeys.Value P:JavaScriptCore.JSPropertyDescriptorKeys.Writable P:JavaScriptCore.JSValue.Context P:JavaScriptCore.JSValue.IsArray +P:JavaScriptCore.JSValue.IsBigInt P:JavaScriptCore.JSValue.IsBoolean P:JavaScriptCore.JSValue.IsDate P:JavaScriptCore.JSValue.IsNull @@ -80655,6 +80671,7 @@ T:iTunesLibrary.ITLibrary T:iTunesLibrary.ITLibraryNotifications T:iTunesLibrary.MediaItemProperty T:JavaScriptCore.JSPromiseCreationExecutor +T:JavaScriptCore.JSRelationCondition T:LinkPresentation.LPErrorCode T:LinkPresentation.LPLinkMetadata T:LinkPresentation.LPLinkView diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-JavaScriptCore.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-JavaScriptCore.todo deleted file mode 100644 index 4e4a2ea640e7..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-JavaScriptCore.todo +++ /dev/null @@ -1,25 +0,0 @@ -!missing-enum! JSRelationCondition not bound -!missing-pinvoke! JSBigIntCreateWithDouble is not bound -!missing-pinvoke! JSBigIntCreateWithInt64 is not bound -!missing-pinvoke! JSBigIntCreateWithString is not bound -!missing-pinvoke! JSBigIntCreateWithUInt64 is not bound -!missing-pinvoke! JSValueCompare is not bound -!missing-pinvoke! JSValueCompareDouble is not bound -!missing-pinvoke! JSValueCompareInt64 is not bound -!missing-pinvoke! JSValueCompareUInt64 is not bound -!missing-pinvoke! JSValueIsBigInt is not bound -!missing-pinvoke! JSValueToInt32 is not bound -!missing-pinvoke! JSValueToInt64 is not bound -!missing-pinvoke! JSValueToUInt32 is not bound -!missing-pinvoke! JSValueToUInt64 is not bound -!missing-selector! +JSValue::valueWithNewBigIntFromDouble:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromInt64:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromString:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromUInt64:inContext: not bound -!missing-selector! JSValue::compareDouble: not bound -!missing-selector! JSValue::compareInt64: not bound -!missing-selector! JSValue::compareJSValue: not bound -!missing-selector! JSValue::compareUInt64: not bound -!missing-selector! JSValue::isBigInt not bound -!missing-selector! JSValue::toInt64 not bound -!missing-selector! JSValue::toUInt64 not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/common-JavaScriptCore.ignore b/tests/xtro-sharpie/api-annotations-dotnet/common-JavaScriptCore.ignore index a4491a6bb053..c5ff65d44ed5 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/common-JavaScriptCore.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/common-JavaScriptCore.ignore @@ -109,3 +109,16 @@ !missing-pinvoke! JSValueMakeSymbol is not bound !missing-pinvoke! JSGlobalContextIsInspectable is not bound !missing-pinvoke! JSGlobalContextSetInspectable is not bound +!missing-pinvoke! JSBigIntCreateWithDouble is not bound +!missing-pinvoke! JSBigIntCreateWithInt64 is not bound +!missing-pinvoke! JSBigIntCreateWithString is not bound +!missing-pinvoke! JSBigIntCreateWithUInt64 is not bound +!missing-pinvoke! JSValueCompare is not bound +!missing-pinvoke! JSValueCompareDouble is not bound +!missing-pinvoke! JSValueCompareInt64 is not bound +!missing-pinvoke! JSValueCompareUInt64 is not bound +!missing-pinvoke! JSValueIsBigInt is not bound +!missing-pinvoke! JSValueToInt32 is not bound +!missing-pinvoke! JSValueToInt64 is not bound +!missing-pinvoke! JSValueToUInt32 is not bound +!missing-pinvoke! JSValueToUInt64 is not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-JavaScriptCore.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-JavaScriptCore.todo deleted file mode 100644 index 4e4a2ea640e7..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-JavaScriptCore.todo +++ /dev/null @@ -1,25 +0,0 @@ -!missing-enum! JSRelationCondition not bound -!missing-pinvoke! JSBigIntCreateWithDouble is not bound -!missing-pinvoke! JSBigIntCreateWithInt64 is not bound -!missing-pinvoke! JSBigIntCreateWithString is not bound -!missing-pinvoke! JSBigIntCreateWithUInt64 is not bound -!missing-pinvoke! JSValueCompare is not bound -!missing-pinvoke! JSValueCompareDouble is not bound -!missing-pinvoke! JSValueCompareInt64 is not bound -!missing-pinvoke! JSValueCompareUInt64 is not bound -!missing-pinvoke! JSValueIsBigInt is not bound -!missing-pinvoke! JSValueToInt32 is not bound -!missing-pinvoke! JSValueToInt64 is not bound -!missing-pinvoke! JSValueToUInt32 is not bound -!missing-pinvoke! JSValueToUInt64 is not bound -!missing-selector! +JSValue::valueWithNewBigIntFromDouble:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromInt64:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromString:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromUInt64:inContext: not bound -!missing-selector! JSValue::compareDouble: not bound -!missing-selector! JSValue::compareInt64: not bound -!missing-selector! JSValue::compareJSValue: not bound -!missing-selector! JSValue::compareUInt64: not bound -!missing-selector! JSValue::isBigInt not bound -!missing-selector! JSValue::toInt64 not bound -!missing-selector! JSValue::toUInt64 not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-JavaScriptCore.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-JavaScriptCore.todo index 4e4a2ea640e7..a8b54c34d26f 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-JavaScriptCore.todo +++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-JavaScriptCore.todo @@ -1,17 +1,4 @@ !missing-enum! JSRelationCondition not bound -!missing-pinvoke! JSBigIntCreateWithDouble is not bound -!missing-pinvoke! JSBigIntCreateWithInt64 is not bound -!missing-pinvoke! JSBigIntCreateWithString is not bound -!missing-pinvoke! JSBigIntCreateWithUInt64 is not bound -!missing-pinvoke! JSValueCompare is not bound -!missing-pinvoke! JSValueCompareDouble is not bound -!missing-pinvoke! JSValueCompareInt64 is not bound -!missing-pinvoke! JSValueCompareUInt64 is not bound -!missing-pinvoke! JSValueIsBigInt is not bound -!missing-pinvoke! JSValueToInt32 is not bound -!missing-pinvoke! JSValueToInt64 is not bound -!missing-pinvoke! JSValueToUInt32 is not bound -!missing-pinvoke! JSValueToUInt64 is not bound !missing-selector! +JSValue::valueWithNewBigIntFromDouble:inContext: not bound !missing-selector! +JSValue::valueWithNewBigIntFromInt64:inContext: not bound !missing-selector! +JSValue::valueWithNewBigIntFromString:inContext: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-JavaScriptCore.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-JavaScriptCore.todo deleted file mode 100644 index 4e4a2ea640e7..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-JavaScriptCore.todo +++ /dev/null @@ -1,25 +0,0 @@ -!missing-enum! JSRelationCondition not bound -!missing-pinvoke! JSBigIntCreateWithDouble is not bound -!missing-pinvoke! JSBigIntCreateWithInt64 is not bound -!missing-pinvoke! JSBigIntCreateWithString is not bound -!missing-pinvoke! JSBigIntCreateWithUInt64 is not bound -!missing-pinvoke! JSValueCompare is not bound -!missing-pinvoke! JSValueCompareDouble is not bound -!missing-pinvoke! JSValueCompareInt64 is not bound -!missing-pinvoke! JSValueCompareUInt64 is not bound -!missing-pinvoke! JSValueIsBigInt is not bound -!missing-pinvoke! JSValueToInt32 is not bound -!missing-pinvoke! JSValueToInt64 is not bound -!missing-pinvoke! JSValueToUInt32 is not bound -!missing-pinvoke! JSValueToUInt64 is not bound -!missing-selector! +JSValue::valueWithNewBigIntFromDouble:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromInt64:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromString:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromUInt64:inContext: not bound -!missing-selector! JSValue::compareDouble: not bound -!missing-selector! JSValue::compareInt64: not bound -!missing-selector! JSValue::compareJSValue: not bound -!missing-selector! JSValue::compareUInt64: not bound -!missing-selector! JSValue::isBigInt not bound -!missing-selector! JSValue::toInt64 not bound -!missing-selector! JSValue::toUInt64 not bound diff --git a/tests/xtro-sharpie/common-JavaScriptCore.ignore b/tests/xtro-sharpie/common-JavaScriptCore.ignore index a4491a6bb053..c5ff65d44ed5 100644 --- a/tests/xtro-sharpie/common-JavaScriptCore.ignore +++ b/tests/xtro-sharpie/common-JavaScriptCore.ignore @@ -109,3 +109,16 @@ !missing-pinvoke! JSValueMakeSymbol is not bound !missing-pinvoke! JSGlobalContextIsInspectable is not bound !missing-pinvoke! JSGlobalContextSetInspectable is not bound +!missing-pinvoke! JSBigIntCreateWithDouble is not bound +!missing-pinvoke! JSBigIntCreateWithInt64 is not bound +!missing-pinvoke! JSBigIntCreateWithString is not bound +!missing-pinvoke! JSBigIntCreateWithUInt64 is not bound +!missing-pinvoke! JSValueCompare is not bound +!missing-pinvoke! JSValueCompareDouble is not bound +!missing-pinvoke! JSValueCompareInt64 is not bound +!missing-pinvoke! JSValueCompareUInt64 is not bound +!missing-pinvoke! JSValueIsBigInt is not bound +!missing-pinvoke! JSValueToInt32 is not bound +!missing-pinvoke! JSValueToInt64 is not bound +!missing-pinvoke! JSValueToUInt32 is not bound +!missing-pinvoke! JSValueToUInt64 is not bound diff --git a/tests/xtro-sharpie/iOS-JavaScriptCore.todo b/tests/xtro-sharpie/iOS-JavaScriptCore.todo deleted file mode 100644 index 4e4a2ea640e7..000000000000 --- a/tests/xtro-sharpie/iOS-JavaScriptCore.todo +++ /dev/null @@ -1,25 +0,0 @@ -!missing-enum! JSRelationCondition not bound -!missing-pinvoke! JSBigIntCreateWithDouble is not bound -!missing-pinvoke! JSBigIntCreateWithInt64 is not bound -!missing-pinvoke! JSBigIntCreateWithString is not bound -!missing-pinvoke! JSBigIntCreateWithUInt64 is not bound -!missing-pinvoke! JSValueCompare is not bound -!missing-pinvoke! JSValueCompareDouble is not bound -!missing-pinvoke! JSValueCompareInt64 is not bound -!missing-pinvoke! JSValueCompareUInt64 is not bound -!missing-pinvoke! JSValueIsBigInt is not bound -!missing-pinvoke! JSValueToInt32 is not bound -!missing-pinvoke! JSValueToInt64 is not bound -!missing-pinvoke! JSValueToUInt32 is not bound -!missing-pinvoke! JSValueToUInt64 is not bound -!missing-selector! +JSValue::valueWithNewBigIntFromDouble:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromInt64:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromString:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromUInt64:inContext: not bound -!missing-selector! JSValue::compareDouble: not bound -!missing-selector! JSValue::compareInt64: not bound -!missing-selector! JSValue::compareJSValue: not bound -!missing-selector! JSValue::compareUInt64: not bound -!missing-selector! JSValue::isBigInt not bound -!missing-selector! JSValue::toInt64 not bound -!missing-selector! JSValue::toUInt64 not bound diff --git a/tests/xtro-sharpie/macOS-JavaScriptCore.todo b/tests/xtro-sharpie/macOS-JavaScriptCore.todo index 4e4a2ea640e7..a8b54c34d26f 100644 --- a/tests/xtro-sharpie/macOS-JavaScriptCore.todo +++ b/tests/xtro-sharpie/macOS-JavaScriptCore.todo @@ -1,17 +1,4 @@ !missing-enum! JSRelationCondition not bound -!missing-pinvoke! JSBigIntCreateWithDouble is not bound -!missing-pinvoke! JSBigIntCreateWithInt64 is not bound -!missing-pinvoke! JSBigIntCreateWithString is not bound -!missing-pinvoke! JSBigIntCreateWithUInt64 is not bound -!missing-pinvoke! JSValueCompare is not bound -!missing-pinvoke! JSValueCompareDouble is not bound -!missing-pinvoke! JSValueCompareInt64 is not bound -!missing-pinvoke! JSValueCompareUInt64 is not bound -!missing-pinvoke! JSValueIsBigInt is not bound -!missing-pinvoke! JSValueToInt32 is not bound -!missing-pinvoke! JSValueToInt64 is not bound -!missing-pinvoke! JSValueToUInt32 is not bound -!missing-pinvoke! JSValueToUInt64 is not bound !missing-selector! +JSValue::valueWithNewBigIntFromDouble:inContext: not bound !missing-selector! +JSValue::valueWithNewBigIntFromInt64:inContext: not bound !missing-selector! +JSValue::valueWithNewBigIntFromString:inContext: not bound diff --git a/tests/xtro-sharpie/tvOS-JavaScriptCore.todo b/tests/xtro-sharpie/tvOS-JavaScriptCore.todo deleted file mode 100644 index 4e4a2ea640e7..000000000000 --- a/tests/xtro-sharpie/tvOS-JavaScriptCore.todo +++ /dev/null @@ -1,25 +0,0 @@ -!missing-enum! JSRelationCondition not bound -!missing-pinvoke! JSBigIntCreateWithDouble is not bound -!missing-pinvoke! JSBigIntCreateWithInt64 is not bound -!missing-pinvoke! JSBigIntCreateWithString is not bound -!missing-pinvoke! JSBigIntCreateWithUInt64 is not bound -!missing-pinvoke! JSValueCompare is not bound -!missing-pinvoke! JSValueCompareDouble is not bound -!missing-pinvoke! JSValueCompareInt64 is not bound -!missing-pinvoke! JSValueCompareUInt64 is not bound -!missing-pinvoke! JSValueIsBigInt is not bound -!missing-pinvoke! JSValueToInt32 is not bound -!missing-pinvoke! JSValueToInt64 is not bound -!missing-pinvoke! JSValueToUInt32 is not bound -!missing-pinvoke! JSValueToUInt64 is not bound -!missing-selector! +JSValue::valueWithNewBigIntFromDouble:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromInt64:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromString:inContext: not bound -!missing-selector! +JSValue::valueWithNewBigIntFromUInt64:inContext: not bound -!missing-selector! JSValue::compareDouble: not bound -!missing-selector! JSValue::compareInt64: not bound -!missing-selector! JSValue::compareJSValue: not bound -!missing-selector! JSValue::compareUInt64: not bound -!missing-selector! JSValue::isBigInt not bound -!missing-selector! JSValue::toInt64 not bound -!missing-selector! JSValue::toUInt64 not bound