Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Alternatives to `preferNullPrototype`

未关闭
#24 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
活跃
技术栈
javascript

调研方向

Start with issue #24 and compare the proposed names against its stated constraints around Arrays, Objects, JSON import attributes, and allowed values. Done means the naming and scope question has a decided direction; no file or test entry point is mentioned in the payload.

由索引模型根据 Issue 内容生成。

描述

preferNullPrototype is the current key name for the following reasons:

  1. nullPrototype was passed over because it is only the non-Array Objects that get null prototypes; Arrays do not.
  2. nullPrototypeForObjects or similar was passed over because Arrays technically are Objects so this still has the same problem as (1)

While advancing this proposal to Stage 2.7, I think the committee was split on (1) but generally agreed that (2) is a bit too pedantic. So we are reconsidering names that somehow mention Object -- we heard the following in committee:

nullPrototypeObjects: boolean
nullObjectPrototype: boolean

We also heard the following:

objectPrototype: null | ???

This option opens the door do doing things like objectPrototype: MyThing.prototype where MyThing is some user-defined class. This would not be possible in import attributes, assuming we add this key to JSON import attributes. It also would expand the scope of this proposal considerably. So assuming we are not going to do that, null and undefined (which would lead to the default Object.prototype) would be the only permissible values for objectPrototype.

I think my current weak preference is for nullPrototypeObjects.

主要语言
HTML
星标
52
派生
4
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tc39/proposal-json-parseimmutable 的其他 Issue

查看 tc39/proposal-json-parseimmutable 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。