-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add mode to throw on invalid prop access, fixes #25 #27
base: master
Are you sure you want to change the base?
Conversation
Note that the fix for #21 will want to land before this one, at which time I'll rebase this PR. (This has been done). |
e88d7b4
to
cd8ea07
Compare
36a21ef
to
93db993
Compare
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.
Sorry I missed this for so long! I guess I haven't opened up my GitHub review queue in a while.
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.
Minor nits only re: use of var vs const.
var lexer = new Lexer(grammar); | ||
|
||
function toTree(exp) { | ||
var p = new Parser(grammar); |
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.
and var
here.
return e.eval(toTree("(2 + 3) * 4")).should.become(20); | ||
}); | ||
it("should evaluate a string concat", function() { | ||
var e = new Evaluator(grammar, null, null, null, true); |
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.
and here etc.
@@ -107,7 +110,7 @@ describe("Evaluator", function() { | |||
}); | |||
it("should throw when transform does not exist", function() { | |||
var e = new Evaluator(grammar); | |||
return e.eval(toTree('"hello"|world')).should.reject; | |||
return e.eval(toTree('"hello"|world')).should.be.rejected; |
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.
What is the difference here?
Add mode to throw on invalid property access. In the default mode, everything should stay the same. In the new mode, there are various semantic changes, so we'll need to roll this out to Firefox with care.
Note that this branch is based on https://github.com/mozilla/mozjexl/pull/31/files so that we can actually see whether anything got broken in CI.