Reflect.construct on a TypedArray reads the buffer before newTarget's prototype
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 57/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c, javascript
Direzione di ricerca
Start by tracing the TypedArray constructor’s buffer-argument path and compare its order of operations with the no-argument path described in the reproduction. Run the supplied qjs commands to confirm the mismatch; done means the buffer case raises the revoked-Proxy TypeError before inspecting the buffer, matching the expected behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Reproduction
const r = Proxy.revocable(function(){}, {});
r.revoke();
Reflect.construct(Float32Array, [new ArrayBuffer(2)], r.proxy);
Expected
The TypeError raised by reading prototype from a revoked Proxy.
V8 (15.6.20):
$ v8 -e 'const r = Proxy.revocable(function(){}, {}); r.revoke(); Reflect.construct(Float32Array, [new ArrayBuffer(2)], r.proxy);'
unnamed:1: TypeError: Cannot perform 'get' on a proxy that has been revoked
Actual (QuickJS-ng)
$ qjs -e 'const r = Proxy.revocable(function(){}, {}); r.revoke(); Reflect.construct(Float32Array, [new ArrayBuffer(2)], r.proxy);'
RangeError: invalid length
Spec
The TypedArray constructor calls AllocateTypedArray before it looks at its first argument, and the first step of AllocateTypedArray is GetPrototypeFromConstructor, which reads Get(ctor, "prototype"). On a revoked Proxy that read throws, so nothing about the buffer or the length is ever computed.
Dropping the buffer argument makes QuickJS take the correct path, which localises the defect to the buffer branch:
$ qjs -e 'const r = Proxy.revocable(function(){}, {}); r.revoke(); Reflect.construct(Float32Array, [], r.proxy);'
TypeError: revoked proxy
JavaScriptCore, SpiderMonkey, GraalJS and V8 all raise a revoked-Proxy TypeError with the buffer argument present.
Versions
- QuickJS-ng: 0.17.0
- V8: 15.6.20
- Lingua principale
- C
- Stelle
- 3.9k
- Fork
- 389
- Merge medio
- 4g 1h
- PR unite (30g)
- 24
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di quickjs-ng/quickjs
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
quickjs-ng/quickjs#1836 ·
I maintainer di solito rispondono entro 2 giorni
-
Array.prototype.find frees an element twice when interrupted between iterationsForse già presa @josefguenther l’ha presa 13 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
quickjs-ng/quickjs#1792 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Object.prototype.propertyIsEnumerable converts `this` before the property keyForse già presa @SomSamantray l’ha presa 9 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
quickjs-ng/quickjs#1772 ·
I maintainer di solito rispondono entro 2 giorni
-
Deserialization corrupts data or returns `undefined` when a RegExp precedes a shared object referenceForse già presa @Sree24-ui l’ha presa 13 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quickjs-ng/quickjs#1771 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
quickjs-ng/quickjs#1835 · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di quickjs-ng/quickjs
Issue simili
-
[LOGO] Add Ruxt Linux LogoApertalogo request
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
fastfetch-cli/fastfetch#2661 ·
I maintainer di solito rispondono entro 1 giorno
-
Mark ignored Mac OS partitions RecoveryOSContainer and iBootSystemContainerForse già presa @meven l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
storaged-project/udisks#1559 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
awslabs/aws-checksums#121 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 3 giorni
-
Bad tag for language cardAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100