Skip to content

Commit

Permalink
Also handle let
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Jan 2, 2020
1 parent 9e0b00c commit 277836e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/evaluateSnippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ try {
} catch (e) {
transpile = function transpile(code) {
// Avoid "Identifier '...' has already been declared"
return code.replace(/\bconst\s/g, 'var ');
return code.replace(/\b(?:const|let)\s/g, 'var ');
};
}

Expand Down

0 comments on commit 277836e

Please sign in to comment.