benjycui / benjycui/jsonml.js

utils.appendChild mutates child fragment

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12
Forks
7
PR merge metrics
No merged PRs in 30d

Description

When calling `utils.appendChild` with a child fragment, the fragment is mutated, resulting in an empty array.

```js
const jml = ['div'];
const fragment = ['', 'hello world'];
utils.appendChild(jml, fragment);
// jml === ['div', 'hello world']
// fragment === []
```

Ideally, the fragment should not be mutated.
See discussion: https://github.com/benjycui/jsonml.js/pull/5#discussion_r146114631

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.