[webkit-changes] [WebKit/WebKit] e8e344: [JSC] Reland JavaScript BigInt Public C API

Commit Queue noreply at github.com
Thu May 9 14:43:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e8e34401087195314e5831bf97523f1813a49516
      https://github.com/WebKit/WebKit/commit/e8e34401087195314e5831bf97523f1813a49516
  Author: Yijia Huang <yijia_huang at apple.com>
  Date:   2024-05-09 (Thu, 09 May 2024)

  Changed paths:
    M Source/JavaScriptCore/API/JSBase.h
    M Source/JavaScriptCore/API/JSValue.h
    M Source/JavaScriptCore/API/JSValue.mm
    M Source/JavaScriptCore/API/JSValueRef.cpp
    M Source/JavaScriptCore/API/JSValueRef.h
    M Source/JavaScriptCore/API/tests/testapi.cpp
    M Source/JavaScriptCore/API/tests/testapi.mm

  Log Message:
  -----------
  [JSC] Reland JavaScript BigInt Public C API
https://bugs.webkit.org/show_bug.cgi?id=250511
rdar://104194532

Reviewed by Keith Miller.

JavaScriptCore framework provides the ability to evaluate JavaScript programs
within applications developed using Swift and Object-C. While JavaScriptCore
APIs support all JavaScript primitive types except for BigInt type. This patch
introduces BigInt public C APIs for type verification, type access, value
creation, value conversion, and value comparison.

* Source/JavaScriptCore/API/JSBase.h:
* Source/JavaScriptCore/API/JSValue.h:
* Source/JavaScriptCore/API/JSValue.mm:
(+[JSValue valueWithNewBigIntFromString:inContext:]):
(+[JSValue valueWithNewBigIntFromInt64:inContext:]):
(+[JSValue valueWithNewBigIntFromUInt64:inContext:]):
(+[JSValue valueWithNewBigIntFromDouble:inContext:]):
(-[JSValue compareUInt64:]):
(-[JSValue compareInt64:]):
(-[JSValue compareDouble:]):
(-[JSValue compare:]):
(+[JSValue valueWithNewPromiseInContext:fromExecutor:]):
(-[JSValue toInt32]):
(-[JSValue toUInt32]):
(-[JSValue toInt64]):
(-[JSValue toUInt64]):
(-[JSValue isBigInt]):
* Source/JavaScriptCore/API/JSValueRef.cpp:
(JSValueGetType):
(JSValueIsBigInt):
(JSBigIntCreateWithDouble):
(JSBigIntCreateWithUInt64):
(JSBigIntCreateWithInt64):
(JSBigIntCreateWithString):
(JSValueToUInt64):
(JSValueToInt64):
(JSValueToUInt32):
(JSValueToInt32):
(toJSRelationCondition):
(JSValueCompareUInt64):
(JSValueCompareInt64):
(JSValueCompareDouble):
(JSValueCompare):
(JSValueToNumber):
* Source/JavaScriptCore/API/JSValueRef.h:
* Source/JavaScriptCore/API/tests/testapi.cpp:
(TestAPI::checkIsBigIntType):
(TestAPI::checkThrownException):
(TestAPI::testBigInt):
* Source/JavaScriptCore/API/tests/testapi.mm:
(testBigIntAPI):
(testObjectiveCAPI):

Canonical link: https://commits.webkit.org/278588@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list