Skip to content

Commit

Permalink
Merge PR #9: Fix mode rewriting and add deploy command for som-st.git…
Browse files Browse the repository at this point in the history
…hub.io
  • Loading branch information
smarr authored Dec 21, 2020
2 parents cf03d4a + bc11056 commit 5a62f21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"clobber": "rm -Rf build/",
"core-lib": "git submodule update --init --recursive",
"test": "mocha -t 3000 -u bdd ./tests/som/",
"lint": "eslint src tests"
"lint": "eslint src tests",
"deploy-som-st": "npm run browserify && mkdir -p ../som-st.github.io/jssom && cp -r build/. ../som-st.github.io/jssom"
},
"type": "module",
"eslintConfig": {
Expand Down
7 changes: 5 additions & 2 deletions src/som/interpreter/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ export class Node {
const { parent } = this;
let replaced = false;

// eslint-disable-next-line guard-for-in
for (const prop in parent) {
if (prop.indexOf('child_') >= 0) {
if (prop.indexOf('children_') >= 0) { // an array with child nodes
const isChild = prop.indexOf('child_') >= 0;
const isChildren = prop.indexOf('children_') >= 0;
if (isChild || isChildren) {
if (isChildren) { // an array with child nodes
const children = parent[prop];
for (const i in children) {
if (children[i] === this) {
Expand Down

0 comments on commit 5a62f21

Please sign in to comment.