Set polyfill says it is [object Object] but should say [object Set]
Nessuno ha ancora preso questa issue.
- Lingua principale
- C++
- Stelle
- 127k
- Fork
- 25.3k
- Merge medio
- 1g 23h
- PR unite (30g)
- 4
Descrizione
Environment
Any - you can reproduce the issue using only file
https://github.com/facebook/react-native/blob/master/Libraries/vendor/core/Set.js
and any Javascript encironment.
EDIT: Just for the bot, it is completely irrelevant:
Environment:
OS: Windows 10
Node: 10.3.0
Yarn: Not Found
npm: 6.1.0
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.1.0.0 AI-173.4720617
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
Description and Steps to Reproduce
Here is code that creates a simple Set object and then uses the spread operator to spread the Set's contents into a new array.
First, using an environment where the above file was executed/loaded (plus its own dependencies), and I also short-circuited the detection at the beginning that determines whether the polyfill is applied:
const s1 = new Set([1,2,3]);
console.log(Object.prototype.toString.call(s1));
Result:
[object Object]
Expected Behavior
Now for comparison a clean ES6+ environment without anything loaded, so we get a native Set implementation:
const s1 = new Set([1,2,3]);
console.log(Object.prototype.toString.call(s1));
Result:
[object Set]
Guida per i contributori
Apri la guida per i contributori
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.
Direzione di ricerca
Inizia da Libraries/vendor/core/Set.js e riproduci il comportamento segnalato in un ambiente JavaScript usando l’esempio fornito di Object.prototype.toString.call. Confronta il risultato di Set con polyfill con il risultato di Set nativo; il lavoro è completato quando il polyfill restituisce [object Set] per un’istanza di Set.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- mobile
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 48/100