https://codereview.chromium.org/939303002/diff/20001/src/parser.cc
File src/parser.cc (right):
https://codereview.chromium.org/939303002/diff/20001/src/parser.cc#newcode4295
src/parser.cc:4295: pending_error_type_ == kReferenceError
On 2015/02/20 09:11:47, marja wrote:
Can you add a static assert here that there are only those 2 types of
errors (so
that compilation fails here if somebody adds a third type)?
Added a switch() statement, which is the best way I know to statically
assert which values an enum can take.
https://codereview.chromium.org/939303002/diff/20001/src/preparse-data.cc
File src/preparse-data.cc (right):
https://codereview.chromium.org/939303002/diff/20001/src/preparse-data.cc#newcode45
src/preparse-data.cc:45: function_store_.Add(error_type ==
kReferenceError ? 1 : 0);
On 2015/02/20 09:11:47, marja wrote:
Ditto, though, re: previous discussion, I don't see why this version
works any
better (or is more future-proof) than relying on the numeric values.
Eh, I'll use the enum value and add a comment to globals.h.
https://codereview.chromium.org/939303002/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.