HomePhabricator

Work around aggressive exception handling in the tokenizer

Authored by cscott on Jan 24 2019, 6:43 AM.

Description

Work around aggressive exception handling in the tokenizer

We have several uses of console.assert in the tokenizer, but these
are dangerous: in several of the places we invoke the tokenizer, we
catch all exceptions and treat these as "match failed" and then retry
something else. Thus the assertion failure is never seen and instead
it causes a subtle behavior shift, likely leading to difficult-to-diagnose
bugs.

Work around this by defining our own assertion method for use inside
the tokenizer which uses env.log to ensure the assertion failure
is seen.

Follow up to Ie26c5bfb73610aac13c73a7e9d02ce4cc99f8b6b.

Change-Id: I45e0c05f214c986a0104a18688859b97ad752605

Details

Committed
jenkins-botJan 24 2019, 2:48 PM
Parents
rGPAR2ab158f47c2d: Instrument language variant conversions
Branches
Unknown
Tags
Unknown
References
refs/changes/12/486212/2
ChangeId
I45e0c05f214c986a0104a18688859b97ad752605