DataView instances with different contents compare as equal
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, node.js
- 领域
- backend, testing-qa
调研方向
阅读针对ArrayBuffer的deepEqual处理逻辑,以及比较自有可枚举键的回退逻辑;issue指出DataView目前会进入该回退逻辑。根据提供的DataView示例添加一个复现用例,并在宽松和严格两种模式下运行相关测试。当不同的字节内容被判定为不相等,且符合Node的assert.deepEqual行为时,即为完成。
由索引模型根据 Issue 内容生成。
描述
deepEqual returns true for any two DataView instances regardless of their byte length, offset, or contents, in both loose and strict mode. Node's assert.deepEqual (which this package mirrors) compares DataView contents and fails when they differ. ArrayBuffer had the same issue in #94 before explicit support was added, while DataView still falls through to comparing own enumerable keys (of which it has none).
Reproduction (node repro.js):
const deepEqual = require("deep-equal");
const assert = require("assert");
const a = new DataView(new Uint8Array([1, 2, 3]).buffer);
const b = new DataView(new Uint8Array([4, 5, 6]).buffer);
console.log(deepEqual(a, b), deepEqual(a, b, { strict: true }));
try { assert.deepEqual(a, b); console.log("assert: equal"); } catch { console.log("assert: not equal"); }
Actual:
true true
assert: not equal
Expected:
false false
assert: not equal
Tested with deep-equal 2.2.3 (npm) and main (83701ada), Node v26.13.0.
Credit: https://ucsbplse.github.io/
- 主要语言
- JavaScript
- 星标
- 792
- 派生
- 107
- 平均合并
- 9 天 20 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
inspect-js/node-deep-equal 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
inspect-js/node-deep-equal#110 ·
-
难度 4/5 3-5 天 新手友好度 35/100
inspect-js/node-deep-equal#109 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 25/100
inspect-js/node-deep-equal#108 · 5 条评论 ·
-
难度 4/5 3-5 天 新手友好度 15/100
查看 inspect-js/node-deep-equal 的全部 Issue
相似的 Issue
-
ai core enhancement good first issue testing
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
-
cli: `studio --request <missing file>` answers with a raw ENOENT/EISDIR instead of a clear error可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
laaielichter/Ai-edit-studio#81 ·
维护者通常 1 天内回复