CacheControl / CacheControl/json-rules-engine
Cannot convert object to primitive value
- 主要語言
- 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 指出了 almanac 的一行除錯日誌;從這裡開始,並使用 `new Object(null)` 重現該故障。當除錯日誌能夠處理該值而不拋出例外,且所選擇的行為已由回歸測試涵蓋時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript
- 領域
- backend
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100