-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP - Reference Validation #39
base: master
Are you sure you want to change the base?
Conversation
js/core.js
Outdated
} | ||
} | ||
phrases.forEach(function(item){ | ||
if(item.key === "root"){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not just 'root', all phrases need to be checked.
js/core.js
Outdated
phrases.forEach(function(item){ | ||
if(item.key === "root"){ | ||
item.values.forEach(function(i){ | ||
let p = parsePhrase(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you calling parsePhrase? The source has already been parsed at this point.
js/core.js
Outdated
} | ||
}); | ||
references.forEach(function(item){ | ||
if(!phraseBook[item]){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, a key can also be a reference to something stored in localMemory, like this:
root:
- {{ dosomething(123) }}
dosomething(num):
- I have to do {{ num }} things.
num is also a key but doesn't refer to a phrase, but in your check it will throw an error.
Wait, I just realized that there is an issue with this. It is giving some error. |
This only considers |
For #17
There is an issue with this. When I change a seed on a sketch with invalid reference, it says
this.phraseBook
is undefined