You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CRITICAL: getattr() does not have 3rd argument #633
I was surprised that getattr() function does not allow third default argument, which is critically important basic functionality as JavaScript does not raise AttributeErrors when accessing missing attributes and we cannot rely on those.
Activity
AlexECX commentedon May 12, 2019
Funny, I was reminded of it while working on #630 as it was messing with my tests. I've been working with this in the meantime:
boost_transcript.js
If whe can't have getattr throw an exception (but why?), then removing the last
elsewill make the function returnundefinedas usualfaerot commentedon Jul 6, 2019
}else if (failsafe) {this should probably be
}else if (failsafe !== undefined) {as we can pass False, empty string or None as default values
JdeH commentedon Aug 14, 2019
There's no good reason why this is left out.
It will be added in the next minor version.
Thanks for the suggestion!
phfaist commentedon Jul 12, 2022
Hi! I ran across the same issue recently (with Transcrypt 3.9.0 from pypi). Is there anything holding back the associated pull request #727? Thanks!