-
Notifications
You must be signed in to change notification settings - Fork 34
Add @protected
tests and a protectedMode
flag.
#69
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
I'm fine with changing I'd suggest separating these concerns and keep this one purely on changing |
I am in favor of this. |
@protected
tests and a protectedMode
flag.
I'm making a mess of PRs, sorry! ;-) I made a new PR for just the first commit of this PR that just does the renaming: #70. Can discuss that part there and the extra bits here. |
I'm in favor of The spec text as is could be improved. But maybe this is moot if the behavior ends up changing. The current language says that processing is aborted and processors should issue a warning. Does "processing is aborted" mean throw an error and quit? Or just abort that algorithm step and continue? (Based on the tests, you continue.) When it's a warning, what is the behavior? Is that something that should be defined and tested? Since the tests were written to test against warning mode output, this patch at least tries to improve that test coverage for protected terms and null contexts. Tests were also added for the error cases since I imagine implementors would want something like that. But that does depend on specific error strings and spec text. Happy to adjust all this as needed. |
- Check for errors when `@protected` conditions are violated.
- Simplify text in older tests. - Support 'protectedMode' option of 'error' or 'warn'. - Test both 'protectedMode' types where needed. - Using 'e' or 'w' suffix for test id but same input file. - Add more tests of various situations.
23cd03c
to
9cf5468
Compare
Closed in favor of #78. |
If it's decided to change the naming from
@sealed
to@protected
, here's a patch.(replaces #68)
(builds upon #70)
protectedMode
option that can beerror
orwarn
.error
mode will fail on protection violations.warn
mode will not fail but will enforce the protected terms.error
andwarn
mode as needed.A prototype jsonld.js implementation is available.
jsonld.js initially just handled the easier error mode with exceptions. But that was the opposite of what the tests did. The warn mode required some invasive internal passing around of options. But otherwise the
@protected
changes were not too difficult. (At least once you wrap your head around how the warning mode should work!)Items todo for this patch:
protectedMode
.Preview | Diff