-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw exception when using equal
& same
for some variable
#791
Comments
It's a bug in the MemoryCard module. huan/memory-card#39 The presence of this function tells tap that it's an array-like, but then the iterator function returns an invalid response, so Nevertheless, tcompare should handle this case more gracefully. Leaving open, but I guess the solution here is to catch the error from |
Even more minimal example: const t = require('tap')
t.test('same', async t => {
t.same({ [Symbol.iterator] () { return {} } }, undefined)
})
t.test('equal', async t => {
t.equal({ [Symbol.iterator] () { return {} } }, undefined)
}) |
@isaacs Thank you very much for pointing the problem out! I believe I have fixed the iterator problem in the MemoryCard (this commit) by removing the And I totally agree that the Tap should validate the BTW: could you also take a look at the below issue? I believe it's a blocker for ESM module developers/users when they need to publish binary commands under the Windows platform: Thank you very much! |
Anyone encountering this can fix it with |
Versions
equal()
Cannot read property 'length' of nullsame()
Error: undefined is not a functionReproduciable minimum code
NPM Versions:
Code:
Cross-posted from:
undefined is not a function
&Cannot read property 'length' of null
wechaty/wechaty#2304The text was updated successfully, but these errors were encountered: