-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Labels
bugSomething isn't workingSomething isn't workingecosystem-compatibilityTracks a compatibility issue in a third-party package or packages.Tracks a compatibility issue in a third-party package or packages.taming compat
Description
Describe the bug
Seems like a nodejs + override mistake compat issue.
When using a hardened textDecoder with ascii encoding, there is an error on certain platforms.
harden(new TextDecoder('ascii', { fatal: true }))
Cannot assign to read only property 'Symbol(kLatin1FastPath)' of object '[object TextDecoder]'
Steps to reproduce
- lockdown
- make textDecoder with
'ascii'
encoding. - harden the textDecoder
- decode text buffer
lockdown()
t = harden(new TextDecoder('ascii', { fatal: true }))
t.decode(Buffer.from([]))
// SES_UNCAUGHT_EXCEPTION: (TypeError#1)
// TypeError#1: Cannot assign to read only property 'Symbol(kLatin1FastPath)' of object '[object TextDecoder]'
Expected behavior
No error
Platform environment
Nodejs versions checked:
20.18.0
🟢
20.18.2
🟢
20.18.3
❌
20.19.0
❌
20.19.1
❌
20.19.2
❌ (latest v20)
21.0.0
🟢
21.7.3
🟢 (latest v21)
22.0.0
🟢
22.15.1
❌ (latest v22)
24.0.0
❌
24.0.2
❌ (latest v24)
Additional context
Attempted a workaround by warming up the textDecoder (decoding once) before harden
, but harden still broke further use of the text decoder
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingecosystem-compatibilityTracks a compatibility issue in a third-party package or packages.Tracks a compatibility issue in a third-party package or packages.taming compat