Open Hanaasagi opened 1 year ago
1.0.1+a3166457d3122b6b86958c43dce47b86af0dc3e2
Linux 6.5.2-arch1-1 x86_64 unknown
const { File } = require("node:buffer"); const assert = require("node:assert"); { const file = new File([""], "file.txt"); assert.strictEqual(file.name, "file.txt"); } { const file = new File([], "file.txt"); assert.strictEqual(file.name, "file.txt"); }
No assertion error
AssertionError: Expected values to be strictly equal: + actual - expected + undefined - 'file.txt' code: "ERR_ASSERTION"
No response
https://github.com/oven-sh/bun/blob/0404d09cc74d865c09a9c4fa965d078035d07027/src/bun.js/webcore/blob.zig#L1191-L1195
https://github.com/oven-sh/bun/blob/0404d09cc74d865c09a9c4fa965d078035d07027/src/bun.js/webcore/blob.zig#L3330-L3341
When the content is empty, the store variable remains null, which results in the filename not being assigned.
store
filename
any update on this? It's a pain if you are trying to unit test with the File object
File
What version of Bun is running?
1.0.1+a3166457d3122b6b86958c43dce47b86af0dc3e2
What platform is your computer?
Linux 6.5.2-arch1-1 x86_64 unknown
What steps can reproduce the bug?
What is the expected behavior?
No assertion error
What do you see instead?
Additional information
No response