Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ca33dbdecfc7d6e7eeb2df1b64587cc06b90346e
      
https://github.com/WebKit/WebKit/commit/ca33dbdecfc7d6e7eeb2df1b64587cc06b90346e
  Author: Devin Rousso <h...@devinrousso.com>
  Date:   2024-07-16 (Tue, 16 Jul 2024)

  Changed paths:
    A JSTests/stress/uint8array-fromBase64.js
    M JSTests/stress/uint8array-fromHex.js
    A JSTests/stress/uint8array-setFromBase64.js
    M JSTests/stress/uint8array-setFromHex.js
    M JSTests/stress/uint8array-toBase64.js
    M JSTests/stress/uint8array-toHex.js
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/Sources.txt
    M Source/JavaScriptCore/runtime/CommonIdentifiers.h
    A Source/JavaScriptCore/runtime/JSGenericTypedArrayView.cpp
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.cpp
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.cpp
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.h
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeInlines.h

  Log Message:
  -----------
  [JSC] add support for `Uint8Array.fromBase64` and 
`Uint8Array.prototype.setFromBase64`
https://bugs.webkit.org/show_bug.cgi?id=276215

Reviewed by Yusuke Suzuki.

These methods will make it easier for developers to decode typed character/byte 
data.

Note that there are other methods in the related proposal, but for ease of 
reviewing they will be implemented separately.

Spec: <https://tc39.es/proposal-arraybuffer-base64/spec/>
Proposal: <https://github.com/tc39/proposal-arraybuffer-base64>

* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h:
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::finishCreation):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.cpp:
(JSC::uint8ArrayConstructorFromBase64): Added.

* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.h:
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeInlines.h:
(JSC::JSGenericTypedArrayViewPrototype<ViewClass>::finishCreation):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.cpp:
(JSC::uint8ArrayPrototypeSetFromBase64): Added.

* Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h:
* Source/JavaScriptCore/runtime/JSGenericTypedArrayView.cpp: Added.
(JSC::fromBase64):
Create shared utility file for special base64 parsing logic.

* Source/JavaScriptCore/runtime/CommonIdentifiers.h:
Create builtin identifier for `lastChunkHandling`.

* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:

* JSTests/stress/uint8array-fromBase64.js: Added.
* JSTests/stress/uint8array-setFromBase64.js: Added.

* JSTests/stress/uint8array-fromHex.js:
* JSTests/stress/uint8array-setFromHex.js:
* JSTests/stress/uint8array-toBase64.js:
* JSTests/stress/uint8array-toHex.js:

Drive-by: fix a few invalid tests and check that things that should throw 
actually do.
Canonical link: https://commits.webkit.org/281014@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to