Updating typeof check, fixes #17070, !strict due to legacy side effect issues