CacheControl / CacheControl/json-rules-engine

Cannot convert object to primitive value

Aperta
#309 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
3.1k
Fork
507
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

In `almanac` you have debug lines like this:
```js
(0, _debug2.default)('almanac::constructor initialized runtime fact:' + fact.id + ' with ' + fact.value + '<' + _typeof(fact.value) + '>');
```
This line does string concatenation on `fact.value` which seems to also consider passed in `params` as facts. This basically requires that all passed in `params` have a `toString()` function such as what is available in a prototype. However, not all JavaScript variables are guaranteed to have a prototype or a `toString()` function (e.g. `new Object(null)`).

For starters, since this appears to be a debug log line, is there a way to disable this entirely? If not, this should be changed to use something like `fast-safe-stringify` or similar to convert param values to a String form.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.