coffeescript: improve es6 regex performance (#7846)

This commit is contained in:
Lieuwe Rooijakkers
2016-09-29 21:59:06 +02:00
committed by Ben Newman
parent 697e7ae0f7
commit c13fe33aa3

View File

@@ -83,7 +83,7 @@ export class CoffeeCompiler extends CachingCompiler {
let sourceMap = JSON.parse(output.v3SourceMap);
if (source.match(/`|\b(?:import|export|yield)\b/)) {
if (/`|\b(?:import|export|yield)\b/.test(source)) {
// If source contains backticks or features that output as ES2015+,
// pass the coffee output through babel-compiler
const doubleRoastedCoffee =