browserify / browserify/insert-module-globals
Got `nextTick is not a function` when using 7.1.0
- Lingua principale
- JavaScript
- Stelle
- 26
- Fork
- 41
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Original error message is `l is not a function` pointing to the following minified code:
```javascript
f.setImmediate="function"===typeof r?r:function(a){var b=D++,c=2>arguments.length?!1:m.call(arguments,1);n[b]=!0;l(function(){n[b]&&(c?a.apply(null,c):a.call(null),f.clearImmediate(b))});return b}
```
After generating a not minified file, I found the following function:
```js
exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
var id = nextImmediateId++;
var args = arguments.length < 2 ? false : slice.call(arguments, 1);
immediateIds[id] = true;
nextTick(function onNextTick() {
if (immediateIds[id]) {
// fn.call() is faster so we optimize for the common use-case
// @see http://jsperf.com/call-apply-segu
if (args) {
fn.apply(null, args);
} else {
fn.call(null);
}
// Prevent ids from leaking
exports.clearImmediate(id);
}
});
return id;
};
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia riproducendo l’errore `nextTick is not a function` con la versione 7.1.0 e segui l’implementazione generata di `setImmediate` mostrata nel report. Individua dove viene introdotto o trasformato il riferimento a `nextTick`, quindi verifica che il codice generato venga eseguito senza l’errore segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 28/100