CacheControl / CacheControl/json-rules-engine

Cannot convert object to primitive value

オープン
#309 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
3.1k
フォーク
507
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。