Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTestTemplate causing Expected () to start arrow function, but got ';' instead of '=>' ` warning #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
getTestTemplate fix
Modified the getTestTemplate function. The check for `test` availability wasn't accurate enough. `var || 'default'` does not cover a lot of episodes. Infact I was getting an `Expected () to start arrow function, but got ';' instead of '=>' ` warning because `test` was a series of blank spaces so it wasn't undefined so it wasn't been converted in `true` and the trim would transform it in an empty string. Lately `return ();` threw the warning.
Miroku87 authored Apr 11, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 9c07c65d9d0719812f9c6dd6f257d9890ec21802
2 changes: 1 addition & 1 deletion lib/preprocess.js
Original file line number Diff line number Diff line change
@@ -353,7 +353,7 @@ function processIncludeDirective(isStatic, context, opts, match, linePrefix, fil

function getTestTemplate(test) {
/*jshint evil:true*/
test = test || 'true';
test = typeof test === 'undefined' || test === "" || test === null || /\s+/.test(test) ? "true" : test;
test = test.trim();

// force single equals replacement