feat(dart/transform): Add debug transform parameters

Add two transform parameters to aid in debugging the transformer
- `mirror_mode`, with values {`debug`, `none`, and `verbose`}
- `init_reflector`, with values {`true`, `false`}

`mirror_mode`:
- `debug`: Allow reflective access, but log a message if it is used
- `none`: Remove reflective access, `throw` if it is used. Default value
- `verbose`: Allow reflective access, log a stack trace if it is used

`init_reflector`: Whether to generate calls to our generated
`initReflector` code.

These will be useful to reveal areas where the transformer is not generating
appropriate code and to quickly see where reflective accesses occur.

When the pub mode is `transform_dynamic`, we run in MirrorMode.debug
with `init_reflector = false`. This is used for testing purposes.
This commit is contained in:
Tim Blasi
2015-04-17 11:12:35 -07:00
parent 5b4eb0c6d7
commit 77b31ab42f
22 changed files with 343 additions and 22 deletions

View File

@ -14,6 +14,7 @@ dependencies:
code_transformers: '^0.2.5'
dart_style: '^0.1.3'
html: '^0.12.0'
logging: '>=0.9.0 <0.11.0'
source_span: '^1.0.0'
stack_trace: '^1.1.1'
transformers: