Closed jamestalmage closed 8 years ago
@twada -
The function.toString()
seems it to make it easier to edit the helper template. The only issue is it prevents coverage using nyc
because of this. It really only seems to be an issue while I was trying to npm link
this into ava (the solution was explicitly excluding **/babel-plugin-espower/**
in my nyc config).
An alternate solution (should you ever want to add code coverage to this project), would be to move the helper to it's own file and just use fs.readFileSync
.
@jamestalmage Nice optimization!
Just out of curiosity, is function.toString()
portable enough?
fs.readFileSync
approach looks better to me.
fs.readFileSync
added :smile:
@twada - should be good to go
@jamestalmage Looks good to me. I'm going to merge and cut a new release.
@jamestalmage babel-plugin-espower 2.1.1 is out. Thanks!
The current method of creating a PowerAssertRecorder prevents some optimizations by the V8 compiler.
Specifically, it creates many extra closure contexts, and prevents the use of hidden classes.
My test suite was seeing roughly a 5% boost.