mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-27 21:42:53 +00:00
This was preventing https://ubereats.com/ from fully loading, because they are attempting to overwrite setItem. They seem to be trying to add error logging to setItem if it throws, as all they do is add a try/catch block that emits an error log to their monitoring service if it throws. However, because Storage is a legacy platform object with a named property setter (setItem), it will call setItem with the stringified version of the function. This is actually expected as per the spec, Firefox (Gecko) and Epiphany (WebKit) does this too, but Chromium does not as it actually overwrites the function with the new function and does not store the stringified function. The problem is that we had the LegacyOverrideBuiltIns flag accidentally set, so it would return the stored string instead of the built-in function (hence the name), then it would try and call it and throw a "not a function" error. This prevented their JS from going any further. This fix allows their UI to fully load and be fully interactive, though it is quite slow at the moment!
10 lines
976 B
Text
10 lines
976 B
Text
key should still be native: 'function key() { [native code] }'
|
|
key's stringified function was added to storage: 'function () { println(`FAIL: Overriden ${functionName} was called`); }'
|
|
getItem should still be native: 'function getItem() { [native code] }'
|
|
getItem's stringified function was added to storage: 'function () { println(`FAIL: Overriden ${functionName} was called`); }'
|
|
setItem should still be native: 'function setItem() { [native code] }'
|
|
setItem's stringified function was added to storage: 'function () { println(`FAIL: Overriden ${functionName} was called`); }'
|
|
removeItem should still be native: 'function removeItem() { [native code] }'
|
|
removeItem's stringified function was added to storage: 'function () { println(`FAIL: Overriden ${functionName} was called`); }'
|
|
clear should still be native: 'function clear() { [native code] }'
|
|
clear's stringified function was added to storage: 'function () { println(`FAIL: Overriden ${functionName} was called`); }'
|