Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
gjs
gjs
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 98
    • Issues 98
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 15
    • Merge Requests 15
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • gjsgjs
  • Merge Requests
  • !227

Merged
Opened Aug 19, 2018 by Philip Chimento@ptomato🚮Maintainer

byteArray: Add compatibility toString property

  • Overview 5
  • Commits 2
  • Pipelines 3
  • Changes 5

This overrides, on each Uint8Array returned from an introspected function or from ByteArray.fromString() or ByteArray.fromGBytes(), the toString() property with a compatibility shim that preserves the old behaviour of ByteArray.prototype.toString() while logging a compatibility warning asking people to fix their code.

This ByteArray.toString() -> Uint8Array.toString() change has had more fallout in application code than I expected, so it seems better to preserve backwards compatibility. (The old behaviour was to decode the byte array into a string with default encoding UTF-8, and the default behaviour of Uint8Array is to return a string with the decimal digits of each byte joined with commas. So the effect was that strings like "97,98,99,100" would show up in UIs where previously "abcd" would have been printed.

This is only on specific instances, so Uint8Array.prototype.toString() remains untouched.

Assignee
Assign to
Reviewer
Request review from
GNOME 3.30.0
Milestone
GNOME 3.30.0 (Past due)
Assign milestone
Time tracking
Reference: GNOME/gjs!227
Source branch: compatibility-bytearray-tostring

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.