microsoft / microsoft/TypeScript
Support `proposal-json-parse-with-source` (`JSON.rawJSON()`, `JSON.isRawJSON()`, `context` parameter of `reviver` function, etc...)
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Go
- Estrelas
- 111k
- Forks
- 14.3k
- Merge médio
- 2d 4h
- PRs com merge (30d)
- 132
Descrição
### ⚙ Compilation target
ESNext
### ⚙ Library
ESNext
### Missing / Incorrect Definition
`JSON.rawJSON()` appears to be missing. Apologies if I've missed something or if this is the wrong place to raise an issue. I searched through both PRs and issues in both this repo and https://github.com/microsoft/TypeScript-DOM-lib-generator but couldn't find any references for it.

### Sample Code
```TypeScript
// https://www.typescriptlang.org/play/?target=99#code/MYewdgzgLgBAHjAvDAUgZQPIDkB0AnAQwHd1sAKAcgAYKBKIA
const x = JSON.rawJSON('0')
```
### Documentation Link
Per https://github.com/microsoft/TypeScript/issues/19044 it seems like TypeScript's policy is to support Stage 3+ features and [proposal-json-parse-with-source](https://github.com/tc39/proposal-json-parse-with-source) is stage 3. (If I misunderstood the typescript teams policy on experimental features it would be awesome to have this documented in https://github.com/Microsoft/TypeScript/wiki/FAQ)
MDN also documents this feature [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/rawJSON).
Additionally, it appears to have been implemented [in V8](https://github.com/v8/v8/commit/e2f909764780a62017788e69f85c89d915185f40) and [in webkit](https://github.com/WebKit/WebKit/pull/7057).
Testing experimentally, it is available in node 22+ and in the latest Chromium as well:


Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece revisando as definições da biblioteca ESNext e comparando suas APIs JSON com a especificação proposal-json-parse-with-source. Use o exemplo de TypeScript na issue para verificar as declarações ausentes, incluindo JSON.rawJSON(), JSON.isRawJSON() e o parâmetro de contexto do reviver, e então verifique se o destino ESNext as aceita.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript, typescript
- Domínio
- compilers
- Tipo de issue
- Funcionalidade
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100