CacheControl / CacheControl/json-rules-engine

Cannot convert object to primitive value

Ouverte
#309 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
3.1k
Forks
507
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.