-
Notifications
You must be signed in to change notification settings - Fork 203
Adds support for @included
in compaction, expansion and flattening.
#349
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
Conversation
Not directly related, but it touched on some of the same code, so I added some support for keyword oddities. |
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.
Thanks, @gkellogg! This mostly looks ok to me ... I'm not sure we want console.warn
in there (does this break some environments, @davidlehn?).
@@ -350,6 +350,11 @@ api.createTermDefinition = ({ | |||
'Invalid JSON-LD syntax; keywords cannot be overridden.', | |||
'jsonld.SyntaxError', | |||
{code: 'keyword redefinition', context: localCtx, term}); | |||
} else if(term.match(/@[a-zA-Z]+$/)) { | |||
// FIXME: remove logging and use a handler | |||
console.warn('WARNING: terms beginning with "@" are reserved' + |
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.
Using console.warn
here is the same issue that resulted in the protectedMode
warn/error
flag. That was supposed to eventually change a better handler, but that hasn't been designed yet. Might want another similar flag and we can fix them all at once. The machinery to pass around those options still exists so would be easy to add. I'm not sure what the best behavior even is.
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.
I'll leave this for you to come up with a comprehensive solution. There are other areas where the spec says to generate warnings.
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.
Ok. Printing out warnings to a console can be invisible for backend code and UIs, hence the idea to have some of handler. I haven't put time into a design for that. A more strict mode that throws errors seems useful to me as well.
4018bf0
to
26c6884
Compare
Coded added for framing, but not enabled due to big backlog on framing in general.
…turning, otherwise delete the new mapping.
Code added for framing, but not enabled due to big backlog on framing in general.