Bug 250618
Summary: | window.atob() returns wrong value when given a string container only white spaces | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | ap, bfulgham, karlcow |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ahmad Saleem
Hi Team,
While going through Blink's commit, I came across another failing test:
Blink Commit - https://chromium.googlesource.com/chromium/blink/+/4a9564e53be4b85ac10a463b3dac03f59b7cba18
WebKit Source - https://searchfox.org/wubkat/source/Source/WTF/wtf/text/Base64.cpp#192
Just wanted to raise so if needed, we can fix it. Will tag others to get input.
Thanks!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
Test - https://jsfiddle.net/2q73Lwf4/show
Failing (in STP161 & Firefox Nightly 111):
FAIL window.btoa() should throw TypeError: Failed to execute 'btoa' on 'Window': 1 argument required, but only 0 present.. Threw exception TypeError: Not enough arguments.
FAIL window.atob() should throw TypeError: Failed to execute 'atob' on 'Window': 1 argument required, but only 0 present.. Threw exception TypeError: Not enough arguments.
______
Chrome Canary 111 passes all.
Karl Dubost
All the tests pass in https://wpt.fyi/results/html/webappapis/atob/base64.any.html?label=experimental&label=master&aligned
The Fiddle test is wrong. It is trying to test the full error message.
https://jsfiddle.net/2q73Lwf4/show
Safari TP 161
typeerror: Not enough arguments
Firefox Nightly 110
Uncaught TypeError: Window.atob: At least 1 argument required, but only 0 passed
Chrome Canary 111
Uncaught TypeError: Failed to execute 'atob' on 'Window': 1 argument required, but only 0 present.
They all throw with TypeError with window.atob()
and they all return the empty string '' for window.atob(" ")