Closed pdawyndt closed 1 year ago
It seems like Node (and Chrome) don't enforce strict mode in this case, even though they should. For example, the following code violates strict mode:
class Example {
static test = {
00: '',
05: 'VIJF NA',
10: 'TIEN NA'
};
}
However, both node --check
and the Chrome console accept it without issue:
However, most libraries do not accept it, and neither does Firefox:
Some solutions could be:
node --check
that does check itThat last one is annoying, since that step shouldn't fail (so if it does, it should be an internal error instead).
Enabling strict mode everywhere is not as simple as it looks, since NodeJS apparently doesn't honour the --use-strict
flag (see https://github.com/nodejs/node/issues/30039). It also became clear that the NodeJS people aren't a big fan of the flag.
A more robust way to enforce strict mode would then be to add "use strict"
to every submission, but that is more work, although we do have support for this kind of thing.
A check of all the latest submissions from "Scriptingtalen" didn't reveal any instance where enabling strict mode changed the result.
FYI: Here's an example of a submission where the student enabled strict mode himself.
Example: submission 13892016
Comment by @niknetniko: