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

Add comment support to @gate pragma #21881

Merged
merged 1 commit into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions scripts/babel/__tests__/transform-test-gate-pragma-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ describe('transform-test-gate-pragma', () => {
test('single quoted strings', () => {
expect(shouldPass).toBe(true);
});

// @gate flagThatIsOn // This is a comment
test('line comment', () => {
expect(shouldPass).toBe(true);
});
});

describe('transform test-gate-pragma: actual runtime', () => {
Expand Down
4 changes: 4 additions & 0 deletions scripts/babel/transform-test-gate-pragma.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ function transform(babel) {
tokens.push({type: next2});
i += 2;
continue;
case '//':
// This is the beginning of a line comment. The rest of the line
// is ignored.
return tokens;
}

switch (char) {
Expand Down