tc39 / tc39/proposal-immutable-arraybuffer
[[DefineOwnProperty]]: Confusing note about redefinition always failing
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 38
- Forks
- 7
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
This note in [[DefineOwnProperty]] caused confusion during code view:
NOTE: Attempting to redefine an immutable value always fails, even if the new value would be cast to the current value.
Maybe just inline ValidateAndApplyPropertyDescriptor and replace https://tc39.es/proposal-immutable-arraybuffer/#sec-typedarray-defineownproperty, steps 1.b.ii-viii with:
- Let mutable be true.
- If IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, set mutable to false.
- If Desc has a [[Configurable]] field and Desc.[[Configurable]] is not mutable, return false.
- If Desc has an [[Enumerable]] field and Desc.[[Enumerable]] is false, return false.
- If IsAccessorDescriptor(Desc) is true, return false.
- If Desc has a [[Writable]] field and Desc.[[Writable]] is not mutable, return false.
- If Desc has a [[Value]] field, then
- If mutable is false, then
- Let current be TypedArrayGetElement(O, numericIndex).
- Assert: current is not undefined.
- Return SameValue(Desc.[[Value]], current).
- Perform ? TypedArraySetElement(O, numericIndex, Desc.[[Value]]).
- Return true.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el algoritmo [[DefineOwnProperty]] de la propuesta y los pasos referenciados de ValidateAndApplyPropertyDescriptor en la especificación de Immutable ArrayBuffer. Compara la nota actual con las comprobaciones de mutabilidad y la comparación de valores propuestas. Se considera terminado cuando la nota confusa se haya reemplazado por pasos algorítmicos coherentes y el comportamiento de TypedArray enlazado siga estando especificado con precisión.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100